Brilliant Database Software - Home
Database software - Online Help System

Online Help System

Back to Brilliant Database Web-Site | Write to Support | Help Index



Operations with file system


Write to file
(FilePath, Data, )

Used to write the text specified in the Data parameter to the file specified in the FilePath parameter. If the specified file does not exist, it will be created. If the specified file already exists, its content will be replaced. For example:

Write File ("C:\test_write.txt", "Hello World. Time is [$_time]")

RETURN VALUE: Returns 1 if the data has been written to the file successfully.


Read File
(FilePath)

Used to read the content of the file specified in the FilePath parameter.

RETURN VALUE: Returns the content of the file.


Read File Info
(FilePath, ReturnValue)

Returns the attributes of the file specified in the FilePath parameter. The ReturnValue parameter defines the attribute to be returned:

  • Size - file size, bytes;
  • Modified date - date when the file was last modified;
  • Modified time - time when the file was last modified;
  • If file exists - returns 1 if the specified file already exists;

RETURN VALUE: Returns the file attributes.


Rename File
(SourceFilePath, DestanationFilePath)

Used to change the name of a file specified in the SourceFilePath parameter to the name specified in the DestanationFilePath parameter. For example:

Rename File ("c:\mydoc.doc","c:\yourdoc.doc") - renames the file from mydoc.doc into yourdoc.doc.

Rename File ("c:\mydoc.doc","d:\mydoc.doc") - moves the file from disk C on disk D.

RETURN VALUE: Returns 1 if the file has been renamed successfully.


Create Directory
(DirectoryPath)

Used to create the directory (folder) specified in the DirectoryPath parameter. For example:

Create Directory ("c:\test_dir")

RETURN VALUE: Returns 1 if the directory has been created successfully.


Delete Directory
(DirectoryPath)

Used to delete the directory (folder) specified in the DirectoryPath parameter. For example:

Delete Directory ("c:\test_dir")

If the folder specified in the parameter is not empty, it will not be deleted.

RETURN VALUE: Returns 1 if the directory has been deleted successfully.


Copy Files
(From, To, Mask, IncludeSub)

Used to copy the content of the From directory to the To directory. Mask defines the mask with which the files to be copied must comply. If IncludeSub contains yes, the command will also copy all files and folders contained in the source directory. For example:

Copy Files ("c:\test1", "c:\test2", "*.doc", "No") - copies all DOC files from the test1 folder to the test2 folder. At the same time, the nested files will not be copied.

Copy Files ("c:\test1", "c:\test2", "*", "yes") - copies the whole content of the test1 folder to the test2 folder.

RETURN VALUE: Returns 1 if files have been copied successfully.


List Files
(Directory, Mask, IncludeSub)

Returns the list of files contained in the folder specified in the Directory parameter that comply with the specified Mask. Files in the list are separated with the carriage return character; i.e., each line in the returned list will contain only one file. If the IncludeSub parameter contains yes, the list will also include all nested files. To perform operations over each file in the list, you can use the For each line from text loop. Example of obtaining a list:

List Files ("C:\Test", "*.doc", "yes"). If files in the folder specified in the path exist, the command will return a list like this:

c:\Test\MyDoc1.doc
c:\Test\MyDoc2.doc
c:\Test\Folder2\MyDoc3.doc

RETURN VALUE: Returns a list of files.


Delete Files
(Directory, Mask, IncludeSub)

Used to delete files in the folder specified in the Directory parameter that comply with the specified Mask. If the IncludeSub parameter contains yes - the command will also delete all nested files and folders. Example:

Delete Files ("C:\Test", "*.tmp", "yes") - deletes all ZIP archive files in the "C:\Test" folder and in the nested folders.

RETURN VALUE: Returns 1 if files has been deleted successfully.


Note: Since these commands affect the file system of the computer and can potentially harm files, a warning about potential harm will be displayed to the user before the first use of the commands.

See Also:

List of Actions