Here’s how to use movefile() function.
Description:
Move, delete, or rename a file.
Syntax:
movefile(fn,path)
Note:
The function moves file fn to a file specified by parameter path. Delete file fn if path is absent; rename the file if only the file name is specified in the path.
Parameters:
fn |
A file |
path |
The path (with file name) along which the file is moved, or a file name |
Options:
@y |
Force an execution of the function if the target file already exists. Without the option you can’t force an execution. Delete the target file if parameter path is absent. |
@c |
Copy the file. If the target file name is the same as that of the specified file to which it will be moved, the copy fails. |
Return value:
Boolean value
Example:
|
A |
|
1 |
=movefile(file("E://test.property"),"D://testfile.property") |
Move the file to testfile.property file under root directory on driver D |
2 |
=movefile(file("D://testfile.property"),"file.property") |
D://testfile.property is renamed file.property |
3 |
=movefile(file("D://file.property")) |
Delete file.property |
4 |
=movefile@y(file("E://test1.property"),"D://testfile1.property") |
The file testfile1.property already exists. Force the move and override the original file |
5 |
=movefile@c(file("D://testfile1.property"),"file.property") |
Copy the file, instead of renaming it |
6 |
=movefile@cy(file("E://test2.property"),"D:// file.property") |
file.property already exists. Force the copy and override the original file |
7 |
=movefile@y(file("D://testfile1.property")) |
Delete testfile1.property |
Related functions: