Module fs/dir
fs/dir
Async directory operations — create, remove, read, link, rename.
Wraps low-level std/sys/dir with typed APIs using the Exception effect.
Example
{ create_dir, remove_dir, read_dir } :: import "std/fs/dir";
{ Path } :: import "std/path";
main :: (fn(io : Io, exn : Exception) -> unit)({
io.await(create_dir(Path.new(`/tmp/yo_test`), io), { io, exn });
entries := io.await(read_dir(Path.new(`/tmp/yo_test`), io), { io, exn });
io.await(remove_dir(Path.new(`/tmp/yo_test`), io), { io, exn });
});
Types
FileType
enum
FileType
The type of a file system entry.
Variants
| Variant | Fields | Description |
|---|---|---|
File | A regular file. | |
Directory | A directory. | |
Symlink | A symbolic link. | |
Other | An unknown or unsupported file type. |
Functions
create_dir
function
create_dir_str
function
create_dir_all
function
create_dir_all_str
function
remove_dir
function
remove_dir_str
function
remove_file
function
remove_file_str
function
rename
function
rename_str
function
hard_link
function
hard_link_str
function
symlink
function
symlink_str
function
read_dir
function
read_dir_str
function