Create a new directory.
Source position: diskh.inc line 22
function CreateDir( |
const NewDir: RawByteString |
):Boolean; |
const NewDir: UnicodeString |
):Boolean; |
CreateDir creates a new directory with name NewDir. If the directory doesn't contain an absolute path, then the directory is created below the current working directory.
The function returns True if the directory was successfully created, False otherwise.
In case of an error, the function returns False.
|
Remove a directory from the file system. |
Program Example26; { This program demonstrates the CreateDir and RemoveDir functions } { Run this program twice in the same directory } Uses sysutils; Begin If Not DirectoryExists('NewDir') then If Not CreateDir ('NewDir') Then Writeln ('Failed to create directory !') else Writeln ('Created "NewDir" directory') Else If Not RemoveDir ('NewDir') Then Writeln ('Failed to remove directory !') else Writeln ('Removed "NewDir" directory'); End.