The FILE_MOVE procedure renames files and directories, effectively moving them to a new location. The moved files retain their permission and ownership attributes. Within a given filesystem or volume, FILE_MOVE does not copy file data. Rather, it simply changes the file names by updating the directory structure of the filesystem. This operation is fast and safe, but is only possible within a single filesystem. Attempts to move a regular file from one filesystem to another are carried out by copying the file using FILE_COPY, and then deleting the original file. It is an error to attempt to use FILE_MOVE to move a directory from one filesystem to another.
FILE_MOVE, SourcePath, DestPath [, /ALLOW_SAME] [, /NOEXPAND_PATH] [, /OVERWRITE] [, /REQUIRE_DIRECTORY] [, /VERBOSE]
A scalar string or string array containing the names of the files or directories to be moved.
A scalar string or string array containing the names of the destinations to which the files and directories specified by SourcePath are to be moved. If more than one file is to be moved to a given destination, that destination must exist and be a directory.
Attempting to move a file on top of itself by specifying the same file for SourcePath and DestPath is usually considered to be an error. If the ALLOW_SAME keyword is set, no renaming is done and the operation is considered to be successful.
Set this keyword to cause FILE_MOVE to use SourcePath and DestPath exactly as specified, without expanding any wildcard characters or environment variable names included in the paths. See FILE_SEARCH for details on path expansion.
Set this keyword to allow FILE_MOVE to overwrite an existing file.
Set this keyword to cause FILE_MOVE to require that DestPath exist and be a directory.
Set this keyword to cause FILE_MOVE to issue an informative message for every file move operation it carries out.
The following rules govern how FILE_MOVE operates:
Rename the file backup.dat to primary.dat in the current working directory:
FILE_MOVE, 'backup.dat', 'primary.dat'
Create a subdirectory named BACKUP in the current working directory and move all .pro files, makefile, and mydata.dat into it:
FILE_MKDIR, 'BACKUP'
FILE_MOVE, ['*.pro', 'makefile', 'mydata.dat'], 'BACKUP'
5.6 |
Introduced |