FileSystemMove


New to Analytica 6.0

Requires Analytica Enterprise edition or better.

FileSystemMove( source, dest )

Renames a file or folder, moves a file to a new location, or moves a folder and all its contents to a new location.

Parameters

  • «source»: A file path to an existing file or folder to be moved or renamed. If this is a relative path, it is interpreted relative to the CurrentDataFolder(). Wildcards are not accepted. If «source» is a folder, then the entire contents will be moved.
  • «dest»: The destination name. If this is a relative path, it is interpreted relative to the CurrentDataFolder(). When moving a folder, suffix «dest» with '\' if you want to copy into «toPath» and don't suffix with '\' if you want «dest» to be the final name. See the examples below.

Return value

The full path of the file or folder after it has been moved.

Examples

  • When both «source» and «dest» are filenames but in different folders, the file is moved AND renamed.
    FileSystemMove( "C:\MyTemplates\blank.xls", "results.xlsx" )
    ==> Moves it to your CurrentDataFolder, same as where your model resides unless you've changed it.
  • When «source» is a file and «dest» is an existing folder, it moves it into the «dest» folder.
    FileSystemMove( "C:\MyModels\cashFlow.ana", "D:\Backups\Models" )
    ==> moves to "C:\Backups\Models\cashFlow.ana"
  • When «source» is a folder and «dest» ends with \, then it moved it to inside the «dest» folder.
    FileSystemMove( "C:\MyModels", "D:\Backups\" )</code>
    ==> moves the entire folder tree to "D:\Backups\MyModels"
  • When «source» is a folder and «dest» does not end with \, then «dest» is the name of the folder after it is moved.
    FileSystemMove( "C:\MyModels", "D:\Models2" )</code>
    ==> The folder "D:\Models2" is the resulting folder.

Notes

  • Requires Analytica Enterprise edition or better.
  • Can be used (securely) on Analytica Cloud Platform (ACP). You must have read access to the «source» folder and write access to the «dest» folder.

See Also

Comments


You are not allowed to post comments.