An iterator function returning pairs of path and 'file' type
An iterator function which, when called, returns a pair of values until such time as there are no more values.
The path value is the file-system path to the entry (file or directory) and the ftype value is an enumeration type describing the actual type of the entry, notably whether a file or directory.
A string representing some file system path.
Note that the actual path separator string can be gotten with htt.fs.sep.
cwd() → htt.fs.Dir
Return handle to directory at current working directory (CWD).
The string used for path separation on this platform.
path(path) → path
Convert `path` from using '/' to using the OS-dependent path separator.
path_join(string) → path
Joins a series of path components into a path using the OS-specific path separator
dirname(path) → path
Given a path, strips last component from path and returns it
If path is the root directory, returns the empty string.
basename(path) → string
Returns the last component of a file path, excluding trailing separators.
Returns empty string if applied to root path or root of drive.
null_file() → path
Returns the OS-specific 'null' file, such as /dev/null for POSIX-compliant systems.
path() → path?
Get canonical absolute path to this directory.
make_path(path) → nil, string?
Iteratively creates directory at every level of the provided sub path.
Returns success if path already exists and is a directory.
open_dir(string) → htt.fs.Dir, string?
Open directory at `subpath`.
parent() → htt.fs.Dir, string?
Open parent directory.
list() → htt.fs.DirIterator, string?
Return iterator to loop over all items in directory.
walk() → htt.fs.DirIterator, string?
Return iterator for recursively iterating through all contents nested under dir.
remove(string?) → nil, string?
Remove item at subpath (or directory itself).
For directories, this will recursively remove the directory itself and all its contents.
exists(string?) → boolean, string?
Return true if item at subpath, relative to directory, exists.
touch(string) → nil, string?
Create file at subpath, relative to directory.