Reference
Directory
Note: Directory functions are not implemented on the web platform.
From path
| Input | A string. |
|---|---|
| Output | A directory pointing to the given path. |
Signature
directory_fromPath(a: String): DirectoryExample
directory_fromPath("/home/user") // returns a directory objectCreate
| Input | A directory. |
|---|---|
| Output | True if the directory was created, false otherwise. |
Signature
directory_create(a: Directory): BooleanExample
directory_create(directory_fromPath("/home/user/new")) // returns true if successfulExists
| Input | A directory. |
|---|---|
| Output | True if the directory exists, false otherwise. |
Signature
directory_exists(a: Directory): BooleanExample
directory_exists(directory_fromPath("/home/user")) // returns true if it existsDelete
| Input | A directory. |
|---|---|
| Output | True if the directory was deleted, false otherwise. |
Signature
directory_delete(a: Directory): BooleanExample
directory_delete(directory_fromPath("/home/user/old")) // returns true if successfulCopy
| Input | Two directories. |
|---|---|
| Output | True if the directory was copied, false otherwise. |
Signature
directory_copy(a: Directory, b: Directory): BooleanExample
directory_copy(
directory_fromPath("src"),
directory_fromPath("backup")
) // returns true if successfulMove
| Input | Two directories. |
|---|---|
| Output | True if the directory was moved, false otherwise. |
Signature
directory_move(a: Directory, b: Directory): BooleanExample
directory_move(
directory_fromPath("old"),
directory_fromPath("new")
) // returns true if successfulRename
| Input | A directory and a string. |
|---|---|
| Output | True if the directory was renamed, false otherwise. |
Signature
directory_rename(a: Directory, b: String): BooleanExample
directory_rename(directory_fromPath("old"), "new") // returns true if successfulList
| Input | A directory. |
|---|---|
| Output | A list of directories and files in the directory. |
Signature
directory_list(a: Directory): ListExample
directory_list(directory_fromPath("/home/user")) // returns [file1, file2, ...]Path
| Input | A directory. |
|---|---|
| Output | The path of the directory. |
Signature
directory_path(a: Directory): StringExample
directory_path(directory_fromPath("/home/user")) // returns "/home/user"Name
| Input | A directory. |
|---|---|
| Output | The name of the directory. |
Signature
directory_name(a: Directory): StringExample
directory_name(directory_fromPath("/home/user")) // returns "user"Parent
| Input | A directory. |
|---|---|
| Output | The parent directory. |
Signature
directory_parent(a: Directory): DirectoryExample
directory_parent(directory_fromPath("/home/user")) // returns "/home" directory