DADiSP Worksheet Functions > Function Categories > File Manipulation > COPYFILE
Copies one or more files to a destination file or directory.
COPYFILE("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. |
||||||
overwrite |
- |
Optional, an integer confirm delete flag.
|
An integer, the count of the number of files successfully copied.
copyfile("myfun.spl", "myfun.spl.bak")
copies the file myfun.spl to myfun.spl.bak in the current directory. If myfile.spl.bak is overwritten if it already exists.
copyfile("\spldir\*.spl", "E:\splbackup")
copies all files with extension .spl in the directory \spldir to the directory E:\splbackup. The number of files copied is returned.
copyfile("\spldir", "E:\splbackup")
copies all files and sub-directories in the directory \spldir to the directory E:\splbackup. The number of files copied is returned.
COPYFILE copies 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.
If the source name specifies a directory, all of the files and sub-directories are copied to the target directory.
The source name may contain the * and ? characters to specify multiple files.
See MOVEFILE to move one or more source files or a directory to a new destination and delete the original files.