Moves a file.
FileMove ( sourcefile, targetfile )
Argument |
Description |
---|---|
sourcefile |
String for the name of the file you want to move |
targetfile |
String for the name of the location you are moving the file |
Integer. Returns values as follows:
1 – Success
-1 – Error opening sourcefile
-2 – Error writing targetfile
You cannot write to a target file if a file with the same name already exists in the target directory. If you want to copy over a target file, you can use FileCopy and set the replace argument to true.
This example moves a file from the current directory to a different directory and saves the return value in the li_FileNum variable:
integer li_FileNum
li_FileNum = FileMove ("june.csv", & "H:/project/june2000.csv" )