
Function: Create_Directory
Create a directory if it does not exists. This function also creates intermediate directories if neccessary.
Prototype:
string result = create_directory ( string path);
Parameters:
Parameter name | Type | Description |
---|---|---|
Path | string | path to the target directory |
Return value: Type string : Returns "OK" if the direcotry exists or is created. Otherwise an error message.
Example:
string res = create_directory("/Users/ole/Desktop/loggfiles/a/b/c/d/e/f");
Suppose "loggfiles" does not exits from before then the following happens.
- The directory "loggfiles" is created on the desktop of user "ole", then
- "a" inside it, then
- "b" inside "a", then
- "c" inside "b", then
- "d" inside "c", then
- "e" inside "d", then
- finaly "f" inside "e".
Otherwise, if some of the directories in this path does not exists, they are created as needed.
See also:
- Directory_exists
- File_Exists