Module fs
Functions for interacting with the underlying filesystem.
Classes
Dir | Provides access to paths in a directory. |
Enums
DirEntry | Variants in this enum represent a path in the filesystem. |
Functions
define change_dir(dirname: String)
Change the current working directory to dirname
.
IOError
ifdirname
is not valid, or does not exist.
define create_dir(dirname: String, mode: *Integer)
Create directory dirname
with mode
permissions.
Note: On Windows, mode
is ignored.
IOError
ifdirname
cannot be created.
define current_dir: String
Return the current directory.
define read_dir(path: String): Result[String, Dir]
Read the directory indicated by path
.
This attempts to build a cursor for entries in a directory. On success, this function returns a Success
holding the Dir
cursor.
Otherwise, this function returns a Failure
containing a String
description. The String
is suitable for raising as an IOError
, but can also be discarded.
define remove_dir(dirname: String)
Remove directory dirname
.
Note: The directory must be empty.
IOError
ifdirname
cannot be removed.