directory rename, directory rename all, directory rename silently
These functions rename or move directories and come in following flavors:
directory rename will assert an exception if the directory cannot be renamed or moved (e.g. directory not found, access restrictions, etc.) Execution will stop immediately.
directory rename silently will rename or move the directories until a first failure is encountered. In this case, the applicable one of the short error messages on directories and files
will be returned. If no errors have been encountered, "OK" will be returned.
directory rename all tries to rename or move all directories and skips the ones which cannot be renamed. Here, the number of successfully renamed or moved directories will be returned.
Moving directories is only possible inside the same disk volume (i.e. same disk drive / desktop computer / server drive)
Indirect parameter passing is disabled.
2
No. | Type | Description |
---|---|---|
1 input |
set or string | existing path and directory names Every parameter must refer to an existing directory. Path name in front is needed if the directory is not located in the working directory. |
2 input |
set or string | new path and directory names Destination paths and new directory names. The number of existing and new path and directory names must match, otherwise an exception will be asserted. |
Type | Description |
---|---|
numeral or string | Feedback directory rename: Always "OK", because all errors cause exceptions. |
Directory not found
Directory not accessible
Directory is a file
Number of existing and new path and directory names are not equal
directory create( My Folder 1, My Folder 2 );
directory rename( My Folder 1, "My Folder 2\My Folder 3");
if (system info[operating system]=Windows)
system( 'dir /W "My Folder 2"' ); // Show directory listing
else:
system( "ls 'My Folder 2' " ); // Show directory listing
directory delete recursive( "", "My Folder *" );
Datenträger in Laufwerk C: ist Windows
Volumeseriennummer: 96E3-BA76
Verzeichnis von C:\Users\zur-b\OneDrive\Documents\Programme\Beyond4P\B4P_Docu_Maker\My Folder 2
[.] [..] [My Folder 3]
0 Datei(en), 0 Bytes
3 Verzeichnis(se), 58’278’060’032 Bytes frei