DADiSP Worksheet Functions > Function Categories > File Manipulation > MOVEFILE
Moves one or more files to a destination file or directory.
MOVEFILE("srcname", "desname", overwrite)
"srcname" |
- |
A string, the name of the file or directory to copy. The name can include * or ? wildcard characters. |
||||||
"desname" |
- |
A string, the name of the destination file or directory. |
||||||
confirm |
- |
Optional, an integer confirm overwrite flag.
|
The count of the number of files successfully moved.
movefile("myfun.spl", "myfun.spl.bak")
moves the file myfun.spl to myfun.spl.bak in the current directory. myfile.spl.bak is overwritten if it already exists. The original file myfun.spl is removed.
movefile("\spldir\*.spl", "E:\splbackup")
copies all files with extension .spl in the directory \spldir to the directory E:\splbackup. The original files are removed from the source directory. The number of files copied is returned.
movefile("\spldir", "E:\splbackup")
moves all files and sub-directories in the directory \spldir to the directory E:\splbackup. The directory \spldir is removed. The number of files copied is returned.
MOVEFILE moves a source file to a destination file or directory. If the source is a directory or resolves to multiple files, the target must also be a directory. The original files or directory are removed.
If the source name specifies a directory, all of the files and sub-directories are moved to the target directory.
The source name may contain the * and ? characters to specify multiple files.
See COPYFILE to copy one more source files or a directory without deleting the original files.