Dir
IOErr
Tag union of possible errors when reading and writing a file or directory.
This is the same as
File.IOErr
.
DirEntry : Path.DirEntry
Record which represents a directory
This is the same as
Path.DirEntry
.
list! : Str => Result (List Path) [DirErr IOErr]
Lists the files and directories inside the directory.
Path.list_dir!
does the same thing, except it takes aPath
instead of aStr
.
delete_empty! : Str => Result {} [DirErr IOErr]
Deletes a directory if it's empty
This may fail if:
- the path doesn't exist
- the path is not a directory
- the directory is not empty
- the user lacks permission to remove the directory.
Path.delete_empty!
does the same thing, except it takes aPath
instead of aStr
.
delete_all! : Str => Result {} [DirErr IOErr]
Recursively deletes the directory as well as all files and directories inside it.
This may fail if:
- the path doesn't exist
- the path is not a directory
- the directory is not empty
- the user lacks permission to remove the directory.
Path.delete_all!
does the same thing, except it takes aPath
instead of aStr
.
create! : Str => Result {} [DirErr IOErr]
Creates a directory
This may fail if:
- a parent directory does not exist
- the user lacks permission to create a directory there
- the path already exists.
Path.create_dir!
does the same thing, except it takes aPath
instead of aStr
.
create_all! : Str => Result {} [DirErr IOErr]
Creates a directory recursively adding any missing parent directories.
This may fail if:
- the user lacks permission to create a directory there
- the path already exists
Path.create_all!
does the same thing, except it takes aPath
instead of aStr
.