Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>filemove()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FILEMOVE()
 Moves files to another directory
------------------------------------------------------------------------------
 Syntax

     FILEMOVE(<cSourceFile>, <cTargetFile>) --> nErrorCode

 Arguments

     <cSourceFile>  Designates the name and the path of the source file.

     <cTargetFile>  Designates the name and the path of the target file.

 Returns

     FILEMOVE() returns a value of 0 when the file can be moved; otherwise,
     an error code is returned.  The codes are defined below:

     Table 7-14:  FILEMOVE() Error Codes
     ------------------------------------------------------------------------
     Code    Symb. constants        Definition
     ------------------------------------------------------------------------
      0      NO_DISK_ERR            No errors
     -2      ER_FILE_NOT_FOUND      File not found
     -3      ER_PATH_NOT_FOUND      Access path not found
     -5      ER_ACCESS_DENIED       Access denied (e.g., network)
     -17     ER_DIFFERENT_DEVICE    Target file not on same drive
     ------------------------------------------------------------------------

 Description

     If a file is to be copied within a drive and then deleted it from the
     original position, it is quicker to move the file.  FILEMOVE() makes
     this possible.  The directory entries are also changed, which is much
     quicker than copying and deleting.

 Notes

     .  You can use drive designators and access paths in
        <cSourceFile> and <cTargetFile> file names.  Wildcards are not
        permitted.

     .  You can only move a file within a drive.  If the target
        directory already contains a file with the same name as the one from
        <cSourceFile>, the move is not completed.  In this case, FILEMOVE()
        returns a value of -5.  The only option available in this situation,
        is to delete the file in the target directory.

 Example

     Move a file from "\OLD" to "\NEW":

     IF FILEMOVE("\OLD\CUST.DBF", "\NEW\CUST.DBF") = 0
        ? "The file is now in the \NEW directory"
     ENDIF


See Also: FILECOPY()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson