Skip to Content
author's profile photo
Former Member

move file in unix server

Hi all,

I have inbound file that has to be moved to another directory path in the unix server once data can be loaded using open data set.

How is the way to move a file from one directory path to another ?

My inbound file in \usr\in\original\data.txt, wanna move the file data.txt to \usr\in\backup\data.txt.

thanks alots.

alia

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Oct 04, 2005 at 11:19 AM
    DATA: v_filepht LIKE FILENAME-FILEINTERN, "Physical file for p_fnam2
    
    * Open the file in application server
      OPEN DATASET v_filepht FOR OUTPUT IN TEXT MODE.
      IF sy-subrc <> 0.
        MESSAGE s185 WITH v_filepht.           " File opening error
        LEAVE LIST-PROCESSING.
    
      ENDIF.
    
       LOOP AT i_logfile INTO w_logfile.
        TRANSFER w_logfile TO v_filepht.
        CLEAR w_logfile.
    
      ENDLOOP.
    
       IF sy-subrc = 0.
        WRITE:/ text-055, v_filepht, text-056. " File successfully created
      ELSE.
        WRITE:/ text-057, v_filepht.           " Error creating file
      ENDIF.
    
     * Closing the file
    
      CLOSE DATASET v_filepht.
    

    Try this one.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 04, 2005 at 11:25 AM

    Hi Alia,

    have a look hee: how-to-move-a-file-from-one-folder-to-another-usin

    regards Andreas

    Add comment
    10|10000 characters needed characters exceeded