Basic File Operations
Files
 
Image bm1009.GIF new file
 
The new file element serves to create a new file. The file name is entered as a text parameter. When no path to the file exists, it will be created. When the creation operation is successful or if the file already exists, the logical validity flag will be returned. Otherwise the invalidity flag is returned, and, at the same time, the operation error flag is set.
 
Image bm1010.GIF new folder
 
The new folder element serves to create a new folder. The folder name is entered as a text parameter. When no path to the folder exists, it will be created. When the creation operation is successful or if the folder already exists, the logical validity flag will be returned. Otherwise the invalidity flag is returned, and, at the same time, the operation error flag is set.
 
Image bm1011.GIF delete file or folder
 
The delete file or folder element serves to delete a file or a folder. The file or folder name is entered as a text parameter. A file having the R/O attribute (modification prohibition), and a non-empty folder (containing a file or another folder) cannot be deleted. When the deletion operation is successful the logical validity flag will be returned. Otherwise the invalidity flag is returned, and, at the same time, the operation error flag is set.
 
Image bm1012.GIF test of existence
 
The test of existence element serves to find out, whether a disk, a file or a folder exists that has been entered as a parameter. If it exists, the logic validity flag will be returned. By entering a disk specification in form of "disk:" only the disk existence in the computer is tested independently on whether the disk contains a medium (e.g. the floppy disk drive). Following the "disk:\" specification entry (i.e. the disk's ROOT folder) the disk existence including medium presence will be tested. If the access permission to the ROOT of disk is to be tested, then this can be done by the "disk:\*.*" test.
 
Image bm1013.GIF file copy
 
The file copy element copies a file into a new file. The name of the source file is specified by the active file for reading, that of the target file by active file for writing. The target file must not exist (it will not be overwritten). The element returns a logic flag stating the operation success. If the operation is not successful, an invalidity flag will be returned and an operation error flag will be set.
 
Image bm1014.GIF file (folder) move/rename
 
The file (folder) move/rename element enables to change the name of a file or a folder, or to move them in another folder. The name of the source file/folder is specified by the active file/folder for reading, that of the target file/folder by the active file/folder for writing. The target file must not exist (it will not be overwritten). A folder can be moved within the same disk only, a file can be moved between different disks. This element returns a logic flag indicating the operation success. If the operation is not successful, an invalidity flag will be returned and an operation error flag will be set.
 
Image bm1015.GIF file list (list of files and folders)
 
The file list element finds all files and folders according to a specification entered as a text parameter, and returns their list as a multiline text, in which each line represents the name of one file/folder (without a path). When entering the file searching mask the asterisk convention can be utilized ("?" denoting an arbitrary character, "*" replacing a character group). Several file masks may be entered, too, individual masks being separated from one another by the semicolon ";". If no file mask is specified, all files and folders of an active folder will be searched for.

Full Html Context Help of The Peter - Gemtree Software & Children Programming