The move file/folder activity moves files and folders from one place to another on the local file system
Uses System.IOUtils.TDirectory.Move
Uses System.IOUtils.TFile.Move
Activity properties
begin if TDirectory.Exists('C:\...\Codolex\TestData') then TDirectory.Move('C:\...\Codolex\TestData', 'C:\...\Codolex\TestDataMoved'); end; |
Resulting code
By default the folder option is selected. When a folder is moved, all nested files and folders are also moved. After moving, the old folder is deleted.
To move a single file, use the file option.
Source and destination path must be provided, and must be valid folder or file paths, otherwise the generated code will result in an error.
The option 'do when folder exists' provides the ability to check if the source folder exists before moving the folder.
If the destination folder does not exist, a folder will be created.
If the destination folder does exist, the nested files and folder will be moved into the existing folder.
Files that are already present will not be overwritten.
For files, there are some extra options.
The option 'do when file exists' provides the ability to check if the source file exists before copying the file.
The option 'Skip when file exists' determines if the file must be overwritten or skipped if it already exits.