[File_Rename] renames a file or directory. Accepts two parameters, the location of the file or directory to be modified and the location and new name for the file. Optional -FileOverWrite keyword specifies that the destination file should be overwritten if it exists.
The file tags are protected by four different permissions. The user must have permission for all of the following in order to use this tag:
- Permission to use the tag itself.
- Permission to perform the file operation.
- Permission to work in the directory which contains the files.
- The filename extensions of the files which are being worked with must be allowed in Lasso Administration.
[File_Rename: File Name, Destination File Name]
[File_Rename: File Name, Destination File Name, -FileOverWrite]
Use the [File_Rename] tag. The following example renames a file named myfile.txt to thefile.txt.
The [File_Control] ... [/File_Control] tags are essential so the success of the file operation can be determined using the [File_CurrentError] tag.
<?LassoScript
File_Control;
File_Rename: '/myfile.txt', '/thefile.txt';
Output: (File_CurrentError: -ErrorCode) + ': ' + (File_CurrentError);
/File_Control;
?>
0: No Error
Tag Link | [File_Rename] | Category | File |
---|---|---|---|
Type | Process | Data Source | Any |
Support | Preferred | Version | 3.0 |
Output Type | None | Security | Tag,File |
Implementation | Sets | Lasso 5.0,LDML3x |
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft