Please enable JavaScript to view this site.

Codolex

Navigation: Activities > File system

Create file/folder

Scroll Prev Top Next More

The create file/folder activity can be used to create files or folder on the local system

uses System.IOUtils.TDirectory.CreateDirectory

uses System.IOUtils.TFile.AppendAllText

 

CreateFileFolder

Activity properties

 

begin

 TDirectory.Copy('C:\...\Codolex\TestData', 'C:\...\Codolex\TestDataCopy');

end;

Resulting code

 

Folder

The option 'do when folder exists' provides the ability to check if there is already a folder in place with the same name.

If this option is not set, and the folder is in place, the content of the folder will not be deleted.

 

File

For files, there are some other options.

 

OtherOptions

 

The options must be used exclusively and determines if the file must be overwritten or skipped if it already exits.

If the file must be overwritten, an empty file is created and the old file is deleted.

If Skip and Overwrite are both not selected, the file will not be created/overwritten when the file does exist.

© by GDK Software