Dir¶
| Spice | |
|---|---|
Functions¶
mkDir¶
| Spice | |
|---|---|
Creates an empty directory at the specified path, with the specified mode. Creates at max one directory. If the second last path element does not exist, the operation fails
There are predefined constants for the mode available:
MODE_ALL_RWX, MODE_ALL_RW, MODE_ALL_R,
MODE_OWNER_RWX, MODE_OWNER_R, MODE_OWNER_W, MODE_OWNER_X,
MODE_GROUP_RWX, MODE_GROUP_R, MODE_GROUP_W, MODE_GROUP_X,
MODE_OTHER_RWX, MODE_OTHER_R, MODE_OTHER_W, MODE_OTHER_X
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
|
mode |
int |
Returns: int — Result code of the create operation: 0 = successful, -1 = failed
mkDirs¶
| Spice | |
|---|---|
Creates an empty directory at the specified path, with the specified mode. Unlike mkDir, mkDirs can also create nested path structures.
There are predefined constants for the mode available:
MODE_ALL_RWX, MODE_ALL_RW, MODE_ALL_R,
MODE_OWNER_RWX, MODE_OWNER_R, MODE_OWNER_W, MODE_OWNER_X,
MODE_GROUP_RWX, MODE_GROUP_R, MODE_GROUP_W, MODE_GROUP_X,
MODE_OTHER_RWX, MODE_OTHER_R, MODE_OTHER_W, MODE_OTHER_X
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
|
mode |
int |
Returns: int — Result code of the create operation: 0 = successful, -1 = failed
rmDir¶
| Spice | |
|---|---|
Deletes an empty directory at the specified path.
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
Returns: int — Result code of the delete operation: 0 = successful, -1 = failed
renameDir¶
| Spice | |
|---|---|
Renames a directory.
Parameters
| Name | Type | Description |
|---|---|---|
oldPath |
string |
|
newPath |
string |
Returns: int — Result code of the rename operation: 0 = successful, -1 = failed
dirExists¶
| Spice | |
|---|---|
Checks if a directory is existing.
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
Returns: bool — Existing or not
listDir¶
| Spice | |
|---|---|
Lists all files/subdirectories at a given path.
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
listDirRecursive¶
| Spice | |
|---|---|
Lists all files/subdirectories at a given path recursively.
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |