Directory is a data type that allows the management of system directories. It simplifies the development of applications that need to execute actions over system directories and files.
Use Directory data type for typical operations such as creating, copying, moving, renaming and deleting directories. You can also use the Directory data type to obtain the directory attributes such as modification date, time and size.
||Selects the directory in the specified path.
||Returns the result of the last operation.
||Returns the result description of the last operation.
... where ErrCode has one of the following values:
||Operation completed successfully
||Invalid directory instance - when the Source property was not set
||Directory does not exist
||Directory already exists
||Directory not empty
|The directory where files related with the application are stored.
|The directory where temporary files of the application are stored.
|The path to the external storage device, if it exists, otherwise this property has the value of the property "ApplicationDataPath".
For more information about static properties of this data type please refer to Directory Data Type Static properties
||Creates a new directory in the specified source.
||Deletes the specified directory.
||Determines whether the specified directory exists.
||Returns the name of the specified directory.
||Returns the full path name of the specified directory.
||Renames the specified directory.
||Returns the files in the specified directory.
||Returns the directories in the specified directory.
Creates a new directory.
Directory name (character)
Deletes the directory specified in source.
Checks whether the directory specified in source exists.
Msg("The directory exists!")
Msg("The directory does not exist!")
Returns the directory of the file specified in source.
&directory.Source = "c:\temp"
Msg(&directory.GetName()) // screen shows: temp
Returns the absolute name of the directory specified in source.
Msg(&directory.GetAbsoluteName()) // screen shows: c:\temp
Renames the directory specified in source. It can be also used to move the directory changing its current path.
New name of the directory (Character).
Returns the names of files in the specified directory.
for &auxFile in &directory.GetFiles('txt')
// do something
for &auxFile in &directory.GetFiles('*.txt')
// do something
...where &auxFile is defined as a File variable.
Returns the names of directories in the specified directory.
for &auxDir in &directory.GetDirectories()
...where &auxDir is defined as a Directory variable.
Mapped Drives and Network Drives are not supported in web environments