ys::fs
— The YS File System Library🔗
Many of these functions can take a single argument or a list of arguments, or a single list of arguments. They will return their results in the same format.
File System Queries🔗
abs?(Path) → Bool
— Path is absolutedir?(Path) → Bool
— Path is a directoryempty?(Path) → Bool
— Path is empty (file or directory)exec?(Path) → Bool
— Path is executableexists?(Path) → Bool
— Path existsfile?(Path) → Bool
— Path is a regular filelink?(Path) → Bool
— Path is a symbolic linkread?(Path) → Bool
— Path is readablerel?(Path) → Bool
— Path is relativesize?(Path) → Bool
— File is not emptywrite?(Path) → Bool
— Path is writable
Short Form Query Functions🔗
d(Path) → Bool
— Path is a directorye(Path) → Bool
— Path existsf(Path) → Bool
— Path is a regular filel(Path) → Bool
— Path is a symbolic linkr(Path) → Bool
— Path is readables(Path) → Bool
— Path is not emptyw(Path) → Bool
— Path is writablex(Path) → Bool
— Path is executablez(Path) → Bool
— Path is empty (file or directory)
File System Getters🔗
abs(Path) → Path
— Get the absolute pathbasename(Path Ext?) → File
— Get the file name of a path, without extensionctime(Path) → Int
— Get the creation time of a filedirname(Path) → Dir
— Get the directory name of a pathfilename(Path) → File
— Get the file name of a pathglob(Path) → [Path]
— Glob a pathls(dir) → [File]
— List a directorymtime(Path) → Int
— Get the modification time of a filepath(Path) → Path
— Get the canonical pathreadlink(Path) → Path
— Get the path of a symbolic linkrel(Path) → Path
— Get the relative pathwhich(name) → Path
— Find the path of an executable
File System Mutators🔗
cp(Path Path)
— Copy a filecp-r(Path Path)
— Copy a directorymkdir(Path) → Dir
— Create a directorymkdir-p(Path) → Dir
— Create a directory and all parent directoriesmv(Path Path)
— Move a filerm(Path) → Path
— Remove a filerm-r(Path) → Path
— Remove a directory and all files in itrmdir(Path) → Path
— Remove a directorytouch(Path) → Path
— Create a file if it doesn't exist, or update its modification time