file delete multiple, file delete multiple all, file delete recursive, file delete recursive all
These functions delete multiple files in specified directories. Wildcards are supported to select files to delete.
file delete multiple ... Only the directory / directories specified in 1st parameter will be considered to search and delete files
file delete recursive ... All subdirectories are also included for searching and deleting these files
file delete ... all will try to delete all files, skipping those which cannot be deleted. No exceptions asserted in this case.
Attention: System files are not touched, but hidden files are. No directories will be deleted.
Indirect parameter passing is disabled.
Wildcards are allowed on file names only
1-2
No. | Type | Description |
---|---|---|
1 input |
set or string | path name(s) Names of existing directory paths to delete. Nothing is deleted if the parameter is empty. If the parameter contains a blank string, then current directory is assumed. If the 2nd parameter is not specified, then all files in the specified path are affected. |
Opt. 2 input |
set or string | file name(s) or patterns If number of names or patterns in this function parameter equals to number of path names, then a 1:1 relationship is assumed, i.e.
1st path relates to 1st name, 2nd path to 2nd name, etc. If this parameter contains fewer elemeents, then the last element
will apply for the remaining path names. If this parameter contains more elements, then the excess names or patterns will be ignored. |
Type | Description |
---|---|
numeral | Number of files deleted successfully |
File not found
File locked by another application
File not accessible
File is a directory
directory create( My Folder );
file copy ( {3 : Example_Program.b4p}, { Test123.txt, Test456.txt, "My Folder\Test789.txt" } );
echo(file delete multiple all ( ".", "Test???.txt" ) ); // Returns 2
file copy overwrite ( {3 : Example_Program.b4p}, { Test123.txt, Test456.txt, "My Folder\Test789.txt" } );
echo(file delete recursive all ( ".", "Test???.txt" ) ); // Returns 3
directory delete( My Folder );
2
3
file delete ... Functions
directory delete multiple/recursive ... Functions