A wrapper around node's fs module.
A wrapper around node's fs module.
(absolute? pathstr)
@param {!string} pathstr :: path to test @return {!boolean} is pathstr an absolute path
@param {!string} pathstr :: path to test @return {!boolean} is pathstr an absolute path
(achmod pathstr mode)
Asynchronous chmod {@link https://nodejs.org/api/fs.html#fschmodpath-mode-callback} @param {!(string|Buffer|URL)} pathstr @param {!Number} mode :: must be an integer @return {!Channel} yielding [?err]
Asynchronous chmod {@link https://nodejs.org/api/fs.html#fschmodpath-mode-callback} @param {!(string|Buffer|URL)} pathstr @param {!Number} mode :: must be an integer @return {!Channel} yielding [?err]
(achown pathstr uid gid)
Asynchronous chown {@link https://nodejs.org/api/fs.html#fschownpath-uid-gid-callback} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {!Channel} yielding [?err]
Asynchronous chown {@link https://nodejs.org/api/fs.html#fschownpath-uid-gid-callback} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {!Channel} yielding [?err]
(aclose fd)
Asynchronously close a file-descriptor {@link https://nodejs.org/api/fs.html#fsclosefd-callback} @param {Number} fd :: the file descriptor to close @return {Channel} yielding [?err]
Asynchronously close a file-descriptor {@link https://nodejs.org/api/fs.html#fsclosefd-callback} @param {Number} fd :: the file descriptor to close @return {Channel} yielding [?err]
(acopy-file src dst)
(acopy-file src dst mode)
Asynchronously copy file from src to dst. By default dst is overwritten. {@link https://nodejs.org/api/fs.html#fscopyfilesrc-dest-mode-callback} @param {(string|buffer.Buffer|URL)} src @param {(string|buffer.Buffer|URL)} dst @return {!Channel} yielding [?err]
Asynchronously copy file from src to dst. By default dst is overwritten. {@link https://nodejs.org/api/fs.html#fscopyfilesrc-dest-mode-callback} @param {(string|buffer.Buffer|URL)} src @param {(string|buffer.Buffer|URL)} dst @return {!Channel} yielding [?err]
(acrawl root af)
Asynchronous depth-first recursive crawl through a directory tree, calling the supplied potentially side-effecting function on every node. This function will short and return on an error.
The user supplied function must return a 'result-chan'...a Readport/channel yielding [?err, ?ok]. There is no easy way to get the compiler to enforce this!
@param {!string} root :: where to start the crawl. A file simply returns (af root) @param {!function<string>} af :: async function called on both files & directories @return {!Channel} yields a short circuited [err] or [nil ok]. This depends on the user following the result chan conventions.
Asynchronous depth-first recursive crawl through a directory tree, calling the supplied potentially side-effecting function on every node. This function will short and return on an error. The user supplied function must return a 'result-chan'...a Readport/channel yielding [?err, ?ok]. There is no easy way to get the compiler to enforce this! @param {!string} root :: where to start the crawl. A file simply returns (af root) @param {!function<string>} af :: async function called on both files & directories @return {!Channel} yields a short circuited [err] or [nil ok]. This depends on the user following the result chan conventions.
(adir? pathstr)
Asynchronous directory predicate. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean
Asynchronous directory predicate. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean
(aexecutable? pathstr)
Asynchronously test if a file is executable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process execute permission @return {!Channel} yielding boolean
Asynchronously test if a file is executable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process execute permission @return {!Channel} yielding boolean
(aexists? pathstr)
Asynchronously test if a file or directory exists @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean
Asynchronously test if a file or directory exists @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean
(afile? pathstr)
Asynchronous file predicate. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean
Asynchronous file predicate. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean
(afstat fd)
Asynchronously retrieve a stats map from the file descriptor {@link https://nodejs.org/api/fs.html#fsfstatfd-options-callback} @param {!Number} fd @param {!Channel} yielding [?err edn-stats]
Asynchronously retrieve a stats map from the file descriptor {@link https://nodejs.org/api/fs.html#fsfstatfd-options-callback} @param {!Number} fd @param {!Channel} yielding [?err edn-stats]
(afsync fd)
Asynchronously flush to storage {@link https://nodejs.org/api/fs.html#fsfsyncfd-callback} @param {!Number} fd @return {Channel} yielding [?err]
Asynchronously flush to storage {@link https://nodejs.org/api/fs.html#fsfsyncfd-callback} @param {!Number} fd @return {Channel} yielding [?err]
(aftruncate fd)
(aftruncate fd len)
Asynchronous ftruncate {@link https://nodejs.org/api/fs.html#fsftruncatefd-len-callback} @param {!Number} fd @param {?Number} len @return {!Channel} yielding [?err]
Asynchronous ftruncate {@link https://nodejs.org/api/fs.html#fsftruncatefd-len-callback} @param {!Number} fd @param {?Number} len @return {!Channel} yielding [?err]
(alchown pathstr uid gid)
Asynchronous lchown {@link https://nodejs.org/api/fs.html#fslchownpath-uid-gid-callback} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {!Channel} yielding [?err]
Asynchronous lchown {@link https://nodejs.org/api/fs.html#fslchownpath-uid-gid-callback} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {!Channel} yielding [?err]
(alink src dst)
Asynchronously creates a new link from the src to dst. Will not overwrite newpath if it exists. {@link https://nodejs.org/api/fs.html#fslinkexistingpath-newpath-callback} @param {!(string|Buffer|URL)} src @param {!(string|Buffer|URL)} dst @return {!Channel} yielding [?err]
Asynchronously creates a new link from the src to dst. Will not overwrite newpath if it exists. {@link https://nodejs.org/api/fs.html#fslinkexistingpath-newpath-callback} @param {!(string|Buffer|URL)} src @param {!(string|Buffer|URL)} dst @return {!Channel} yielding [?err]
(alock-file pathstr)
Attempts to asynchronously open a lock-file exclusively. This prevents future openings until the holding lock has been released, thereby can use to prevent reads and writes within a process. A yielded err indicates a failure to obtain a lock, & AsyncLockFile is a record with .release() method to unlock the file, returning a promise-chan yielding [?err] @param {string} pathstr :: the file you want to lock @return {Channel} yielding [?err ?AsyncLockFile]
Attempts to asynchronously open a lock-file exclusively. This prevents future openings until the holding lock has been released, thereby can use to prevent reads and writes within a process. A yielded err indicates a failure to obtain a lock, & AsyncLockFile is a record with .release() method to unlock the file, returning a promise-chan yielding [?err] @param {string} pathstr :: the file you want to lock @return {Channel} yielding [?err ?AsyncLockFile]
(alstat pathstr)
Asynchronous lstat @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err ?edn-stats]
Asynchronous lstat @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err ?edn-stats]
(alutimes pathstr atime mtime)
asynchronous lutimes
asynchronous lutimes - same as utimes but symbolic links are not derefed - If the value is NaN or Infinity, the value would get converted to Date.now() - numerable strings ie '12235' are converted to numbers {@link https://nodejs.org/api/fs.html#fslutimespath-atime-mtime-callback} @param {!(string|Buffer|URL)} pathstr @param {(string|Number)} atime @param {(string|Number)} mtime @return {!Channel} yielding [?err]
(amkdir pathstr)
(amkdir pathstr opts)
Asynchronously create a directory {@link https://nodejs.org/api/fs.html#fsmkdirpath-options-callback} @param {!(string|Buffer|URL)} pathstr :: path of directory to create @param {?IMap} opts :recursive (boolean) -> the first directory path created. :mode (string|number) @return {!Channel} yielding [?err]
Asynchronously create a directory {@link https://nodejs.org/api/fs.html#fsmkdirpath-options-callback} @param {!(string|Buffer|URL)} pathstr :: path of directory to create @param {?IMap} opts :recursive (boolean) -> the first directory path created. :mode (string|number) @return {!Channel} yielding [?err]
(aopen pathstr)
(aopen pathstr flags)
(aopen pathstr flags mode)
Asynchronously open a file-descriptor {@link https://nodejs.org/api/fs.html#fsopenpath-flags-mode-callback} @param {!string} pathstr @return {!Channel} yielding [?err ?fd]
Asynchronously open a file-descriptor {@link https://nodejs.org/api/fs.html#fsopenpath-flags-mode-callback} @param {!string} pathstr @return {!Channel} yielding [?err ?fd]
(aread fd opts)
(aread fd buffer opts)
(aread fd buffer offset length position)
Asynchronously read data from the fd into the specified buffer {@link https://nodejs.org/api/fs.html#fsreadfd-buffer-offset-length-position-callback} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - where data will be written :offset (Number) - where to start writing in the buffer :length (Number) - how many bytes to read from fd :pos (Number|Bigint) - Where to begin reading. if -1 reads from current-pos @return {!Channel} yielding [?err bytes-read buffer]
Asynchronously read data from the fd into the specified buffer {@link https://nodejs.org/api/fs.html#fsreadfd-buffer-offset-length-position-callback} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - where data will be written :offset (Number) - where to start writing in the buffer :length (Number) - how many bytes to read from fd :pos (Number|Bigint) - Where to begin reading. if -1 reads from current-pos @return {!Channel} yielding [?err bytes-read buffer]
(aread-file pathstr enc)
@param {!string} pathstr @param {!string} enc :: if "" (an explicit empty string) => raw buffer @return {!Channel} yielding [?err (str|Buffer)]
@param {!string} pathstr @param {!string} enc :: if "" (an explicit empty string) => raw buffer @return {!Channel} yielding [?err (str|Buffer)]
(areadable? pathstr)
Asynchronously test if a file is readable to the process @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean
Asynchronously test if a file is readable to the process @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding boolean
(areaddir dirpath)
(areaddir dirpath opts)
Asynchronously reads directory content {@link https://nodejs.org/api/fs.html#fsreaddirpath-options-callback} @param {!(string|Buffer|URL)} dirpath :: directory path to read @param {?IMap} opts :: options :encoding (string) -> defaults to 'utf8' :withFileTypes (bool) -> return fs.Dirent objects instead of strings. see {@link https://nodejs.org/api/fs.html#class-fsdirent} @return {!Channel} yielding [?err, ?Vector<string|fs.Dirent>]
Asynchronously reads directory content {@link https://nodejs.org/api/fs.html#fsreaddirpath-options-callback} @param {!(string|Buffer|URL)} dirpath :: directory path to read @param {?IMap} opts :: options :encoding (string) -> defaults to 'utf8' :withFileTypes (bool) -> return fs.Dirent objects instead of strings. see {@link https://nodejs.org/api/fs.html#class-fsdirent} @return {!Channel} yielding [?err, ?Vector<string|fs.Dirent>]
(areadlink pathstr)
Asynchronous readlink. Reads the contents of the symbolic link referred to by path. {@link https://nodejs.org/api/fs.html#fsreadlinkpath-options-callback} @param {!(string|Buffer|URL)} pathstr :: the symbolic link to read @return {!Channel} yielding [?err ?linkstring]
Asynchronous readlink. Reads the contents of the symbolic link referred to by path. {@link https://nodejs.org/api/fs.html#fsreadlinkpath-options-callback} @param {!(string|Buffer|URL)} pathstr :: the symbolic link to read @return {!Channel} yielding [?err ?linkstring]
(arealpath pathstr)
Asynchronous realpath. Computes the canonical pathname by resolving ., .., and symbolic links. {@link https://nodejs.org/api/fs.html#fsrealpathpath-options-callback} @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err ?resolvedPathstr]
Asynchronous realpath. Computes the canonical pathname by resolving ., .., and symbolic links. {@link https://nodejs.org/api/fs.html#fsrealpathpath-options-callback} @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err ?resolvedPathstr]
(arename oldpathstr newpathstr)
Asynchronously rename a file {@link https://nodejs.org/api/fs.html#fsrenameoldpath-newpath-callback} @param {!(string|Buffer|URL)} oldpathstr :: file to rename @param {!(string|Buffer|URL)} newpathstr :: what to rename it to @return {!Channel} yielding [?err]
Asynchronously rename a file {@link https://nodejs.org/api/fs.html#fsrenameoldpath-newpath-callback} @param {!(string|Buffer|URL)} oldpathstr :: file to rename @param {!(string|Buffer|URL)} newpathstr :: what to rename it to @return {!Channel} yielding [?err]
(arm pathstr)
Asynchronously delete the file or directory path @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]
Asynchronously delete the file or directory path @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]
(arm-f pathstr)
Asynchronously delete the file or directory path Ignores paths that do not exist. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]
Asynchronously delete the file or directory path Ignores paths that do not exist. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]
(arm-r pathstr)
Asynchronous recursive delete. Ignores paths that do not exist. Crawls in order provided by readdir and makes unlink/rmdir calls sequentially after the previous has completed. Breaks on any err which is returned as [err] Returns err on does not exist. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]
Asynchronous recursive delete. Ignores paths that do not exist. Crawls in order provided by readdir and makes unlink/rmdir calls sequentially after the previous has completed. Breaks on any err which is returned as [err] Returns err on does not exist. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]
(arm-rf pathstr)
Asynchronous recursive delete. Ignores paths that do not exist. Crawls in order provided by readdir and makes unlink/rmdir calls sequentially after the previous has completed. Breaks on any err which is returned as [err] Returns err on does not exist. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]
Asynchronous recursive delete. Ignores paths that do not exist. Crawls in order provided by readdir and makes unlink/rmdir calls sequentially after the previous has completed. Breaks on any err which is returned as [err] Returns err on does not exist. @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err]
(armdir pathstr)
(armdir pathstr opts)
Asynchronously remove a directory {@link https://nodejs.org/api/fs.html#fsrmdirpath-options-callback} @param {!(string|Buffer|URL)} pathstr :: path of directory to remove @param {?IMap} opts :maxRetries (number) :retryDelay (number) @return {!Channel} yielding [?err]
Asynchronously remove a directory {@link https://nodejs.org/api/fs.html#fsrmdirpath-options-callback} @param {!(string|Buffer|URL)} pathstr :: path of directory to remove @param {?IMap} opts :maxRetries (number) :retryDelay (number) @return {!Channel} yielding [?err]
(astat pathstr)
Asynchronous stat @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err ?edn-stats]
Asynchronous stat @param {!(string|Buffer|URL)} pathstr @return {!Channel} yielding [?err ?edn-stats]
(asymlink targetstr pathstr)
(asymlink targetstr pathstr link_type)
Synchronous symlink. {@link https://nodejs.org/api/fs.html#fssymlinktarget-path-type-callback} @param {!(string|Buffer|URL)} targetstr :: what gets pointed to @param {!(string|Buffer|URL)} pathstr :: the new symbolic link that points to target @param {?string} link_type ::'file' or 'dir' @return {!Channel} yielding [?err]
Synchronous symlink. {@link https://nodejs.org/api/fs.html#fssymlinktarget-path-type-callback} @param {!(string|Buffer|URL)} targetstr :: what gets pointed to @param {!(string|Buffer|URL)} pathstr :: the new symbolic link that points to target @param {?string} link_type ::'file' or 'dir' @return {!Channel} yielding [?err]
(asymlink? pathstr)
Asynchronously test if path is a symbolic link @param {!(string|Buffer|URL)} pathstr :: path to test @return {!Channel} yielding boolean
Asynchronously test if path is a symbolic link @param {!(string|Buffer|URL)} pathstr :: path to test @return {!Channel} yielding boolean
(atouch pathstr)
creates a file if non-existent @param {!string} pathstr @return {!Channel} yielding [?err]
creates a file if non-existent @param {!string} pathstr @return {!Channel} yielding [?err]
(atruncate pathstr)
(atruncate pathstr len)
Asynchronous truncate {@link https://nodejs.org/api/fs.html#fstruncatepath-len-callback} @param {!(string|Buffer|URL)} pathstr @param {?number} len @return {!Channel} yielding [?err]
Asynchronous truncate {@link https://nodejs.org/api/fs.html#fstruncatepath-len-callback} @param {!(string|Buffer|URL)} pathstr @param {?number} len @return {!Channel} yielding [?err]
(aunlink pathstr)
Asynchronously unlink a file {@link https://nodejs.org/api/fs.html#fsunlinkpath-callback} @param {!(string|Buffer|URL)} pathstr :: path of file to unlink @return {!Channel} yielding [?err]
Asynchronously unlink a file {@link https://nodejs.org/api/fs.html#fsunlinkpath-callback} @param {!(string|Buffer|URL)} pathstr :: path of file to unlink @return {!Channel} yielding [?err]
(autimes pathstr atime mtime)
asynchronous utimes. Change the file system timestamps of the object referenced by path.
asynchronous utimes. Change the file system timestamps of the object referenced by path. - If the value is NaN or Infinity, the value would get converted to Date.now() - numerable strings ie '12235' are converted to numbers {@link https://nodejs.org/api/fs.html#fsutimespath-atime-mtime-callback} @param {!(string|Buffer|URL)} pathstr @param {(string|Number)} atime @param {(string|Number)} mtime @return {!Channel} yielding [?err]
(awritable? pathstr)
Asynchronously test if a file is writable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process write permission @return {!Channel} yielding boolean
Asynchronously test if a file is writable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process write permission @return {!Channel} yielding boolean
(awrite fd opts)
(awrite fd buffer opts)
(awrite fd buffer offset length position)
Asynchronously write data from the buffer to the fd {@link https://nodejs.org/api/fs.html#fswritesyncfd-buffer-offset-length-position} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - data to be written :offset (Number) - where to start reading in the buffer :length (Number) - how many bytes to read :pos (Number|Bigint) - where to begin writing in the fd @return {!Channel} yielding [?err bytes-written buffer]
Asynchronously write data from the buffer to the fd {@link https://nodejs.org/api/fs.html#fswritesyncfd-buffer-offset-length-position} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - data to be written :offset (Number) - where to start reading in the buffer :length (Number) - how many bytes to read :pos (Number|Bigint) - where to begin writing in the fd @return {!Channel} yielding [?err bytes-written buffer]
(awrite-file pathstring content opts)
Asynchronously write to a file. @param {!string} pathstring : file to write to @param {(string|buffer.Buffer)} content : if buffer, :encoding is ignored @param {?IMap} opts: :encoding {string} - defaults to utf8. use :append {bool} - add content to existing file. :flags {string} - overrides :append when set :mode {int} - set on newly created files @return {!Channel} promise-chan recieving [?err]
Asynchronously write to a file. @param {!string} pathstring : file to write to @param {(string|buffer.Buffer)} content : if buffer, :encoding is ignored @param {?IMap} opts: :encoding {string} - defaults to utf8. use :append {bool} - add content to existing file. :flags {string} - overrides :append when set :mode {int} - set on newly created files @return {!Channel} promise-chan recieving [?err]
(basename pathstring)
(basename pathstring ext)
@return {!string}
@return {!string}
(chmod pathstr mode)
Synchronous chmod {@link https://nodejs.org/api/fs.html#fsfchmodsyncfd-mode} @param {!(string|Buffer|URL)} pathstr @param {!Number} mode :: must be an integer @return {nil}
Synchronous chmod {@link https://nodejs.org/api/fs.html#fsfchmodsyncfd-mode} @param {!(string|Buffer|URL)} pathstr @param {!Number} mode :: must be an integer @return {nil}
(chown pathstr uid gid)
Synchronous chown {@link https://nodejs.org/api/fs.html#fschownsyncpath-uid-gid} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {nil}
Synchronous chown {@link https://nodejs.org/api/fs.html#fschownsyncpath-uid-gid} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {nil}
(close fd)
Synchronously close a file-descriptor {@link https://nodejs.org/api/fs.html#fsclosesyncfd} @param {Number} fd :: the file descriptor to close @return {nil}
Synchronously close a file-descriptor {@link https://nodejs.org/api/fs.html#fsclosesyncfd} @param {Number} fd :: the file descriptor to close @return {nil}
(copy-file src dst)
(copy-file src dst mode)
Synchronously copy file from src to dst. By default dst is overwritten. {@link https://nodejs.org/api/fs.html#fscopyfilesyncsrc-dest-mode} @param {(string|buffer.Buffer|URL)} src @param {(string|buffer.Buffer|URL)} dst @return {nil}
Synchronously copy file from src to dst. By default dst is overwritten. {@link https://nodejs.org/api/fs.html#fscopyfilesyncsrc-dest-mode} @param {(string|buffer.Buffer|URL)} src @param {(string|buffer.Buffer|URL)} dst @return {nil}
(crawl root f)
Synchronous depth-first recursive crawl through a directory tree, calling the supplied side-effecting function on every node. This function will throw if your supplied f throws on any node. @param {!string} root :: where to start the crawl. A file simply returns (f root) @param {!function<string>} f :: function called on both files & directories returns value of (f top-level-root)
Synchronous depth-first recursive crawl through a directory tree, calling the supplied side-effecting function on every node. This function will throw if your supplied f throws on any node. @param {!string} root :: where to start the crawl. A file simply returns (f root) @param {!function<string>} f :: function called on both files & directories returns value of (f top-level-root)
(dir? pathstr)
@param {!(string|Buffer|URL)} pathstring @return {!boolean} iff abstract pathname exists and is a directory
@param {!(string|Buffer|URL)} pathstring @return {!boolean} iff abstract pathname exists and is a directory
(dirname pathstring)
@param {!string} pathstring :: path to get parent of @return {!string} the parent directory
@param {!string} pathstring :: path to get parent of @return {!string} the parent directory
(executable? pathstr)
@param {!(string|Buffer|URL)} pathstr :: path to test for process executable permission @return {!boolean}
@param {!(string|Buffer|URL)} pathstr :: path to test for process executable permission @return {!boolean}
(exists? pathstr)
Synchronously test if a file or directory exists @param {!(string|Buffer|URL)} pathstr :: file path to test @return {!boolean}
Synchronously test if a file or directory exists @param {!(string|Buffer|URL)} pathstr :: file path to test @return {!boolean}
(ext pathstring)
@param {!string} pathstring :: file to get extension from @return {!string}
@param {!string} pathstring :: file to get extension from @return {!string}
(file? pathstr)
Synchronous file predicate @param {!(string|Buffer|URL)} pathstring @return {!boolean} iff abstract pathname exists and is a file
Synchronous file predicate @param {!(string|Buffer|URL)} pathstring @return {!boolean} iff abstract pathname exists and is a file
(fstat fd)
Synchronously retrieve a stats map from the file descriptor {@link https://nodejs.org/api/fs.html#fsfstatsyncfd-options} @param {!Number} fd @return {!IMap} edn stats
Synchronously retrieve a stats map from the file descriptor {@link https://nodejs.org/api/fs.html#fsfstatsyncfd-options} @param {!Number} fd @return {!IMap} edn stats
(fsync fd)
Synchronously flush to storage {@link https://nodejs.org/api/fs.html#fsfstatsyncfd-options} @param {!Number} fd @return {nil}
Synchronously flush to storage {@link https://nodejs.org/api/fs.html#fsfstatsyncfd-options} @param {!Number} fd @return {nil}
(ftruncate fd)
(ftruncate fd len)
Synchronous ftruncate {@link https://nodejs.org/api/fs.html#fsftruncatesyncfd-len} @param {!Number} fd @param {?Number} len @return {nil}
Synchronous ftruncate {@link https://nodejs.org/api/fs.html#fsftruncatesyncfd-len} @param {!Number} fd @param {?Number} len @return {nil}
(hidden? pathstr)
@param {!(string|Buffer|URL)} pathstr @return {!boolean} is the file hidden (unix only)
@param {!(string|Buffer|URL)} pathstr @return {!boolean} is the file hidden (unix only)
(lchown pathstr uid gid)
Synchronous lchown {@link https://nodejs.org/api/fs.html#fslchownsyncpath-uid-gid} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {nil}
Synchronous lchown {@link https://nodejs.org/api/fs.html#fslchownsyncpath-uid-gid} @param {!(string|Buffer|URL)} pathstr @param {!Number} uid @param {!Number} gid @return {nil}
(link src dst)
Synchronously creates a new link from the src to dst Will not overwrite newpath if it exists. {@link https://nodejs.org/api/fs.html#fslinksyncexistingpath-newpath} @param {!(string|Buffer|URL)} src @param {!(string|Buffer|URL)} dst @return {nil}
Synchronously creates a new link from the src to dst Will not overwrite newpath if it exists. {@link https://nodejs.org/api/fs.html#fslinksyncexistingpath-newpath} @param {!(string|Buffer|URL)} src @param {!(string|Buffer|URL)} dst @return {nil}
(lock-file pathstr)
Attempts to synchronously open a lock-file exclusively. This prevents future openings until the holding lock has been released, thereby can use to prevent reads and writes within a process. If a lock is already held, will throw @param {string} pathstr :: the file you want to lock @return {LockFile} record with .release() method to unlock the file
Attempts to synchronously open a lock-file exclusively. This prevents future openings until the holding lock has been released, thereby can use to prevent reads and writes within a process. If a lock is already held, will throw @param {string} pathstr :: the file you want to lock @return {LockFile} record with .release() method to unlock the file
(lock-path pathstr)
(lstat pathstr)
Synchronous lstat identical to stat(), except that if path is a symbolic link, then the link itself is stat-ed, not the file that it refers to @param {!(string|Buffer|URL)} pathstr @return {!IMap} file stats object converted to edn
Synchronous lstat identical to stat(), except that if path is a symbolic link, then the link itself is stat-ed, not the file that it refers to @param {!(string|Buffer|URL)} pathstr @return {!IMap} file stats object converted to edn
(lutimes pathstr atime mtime)
synchronous lutimes
synchronous lutimes - same as utimes but symbolic links are not derefed - If the value is NaN or Infinity, the value would get converted to Date.now() - numerable strings ie '12235' are converted to numbers {@link https://nodejs.org/api/fs.html#fslutimessyncpath-atime-mtime} @param {!(string|Buffer|URL)} pathstr @param {(string|Number)} atime @param {(string|Number)} mtime @return {nil}
(mkdir pathstr)
(mkdir pathstr opts)
Synchronously create a directory {@link https://nodejs.org/api/fs.html#fsmkdirsyncpath-options} @param {!(string|Buffer|URL)} pathstr :: path of directory to create @param {?IMap} opts :recursive (boolean) -> the first directory path created. :mode (string|Number) @return {nil}
Synchronously create a directory {@link https://nodejs.org/api/fs.html#fsmkdirsyncpath-options} @param {!(string|Buffer|URL)} pathstr :: path of directory to create @param {?IMap} opts :recursive (boolean) -> the first directory path created. :mode (string|Number) @return {nil}
(normalize-path pathstring)
@param {!string} pathstring :: pathstring to normalize @return {!string}
@param {!string} pathstring :: pathstring to normalize @return {!string}
(open pathstr)
(open pathstr flags)
(open pathstr flags mode)
Synchronously open a file-descriptor {@link https://nodejs.org/api/fs.html#fsopenpath-flags-mode-callback} @param {!string} pathstr @return {!Number} integer file-descriptor
Synchronously open a file-descriptor {@link https://nodejs.org/api/fs.html#fsopenpath-flags-mode-callback} @param {!string} pathstr @return {!Number} integer file-descriptor
(permissions st)
@param {!(fs.Stat|IMap)} s :: a fs.Stats object (or as edn) @return {!Number}
@param {!(fs.Stat|IMap)} s :: a fs.Stats object (or as edn) @return {!Number}
(read fd opts)
(read fd buffer opts)
(read fd buffer offset length position)
Synchronously read data from the fd into the specified buffer {@link https://nodejs.org/api/fs.html#fsreadsyncfd-buffer-offset-length-position} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - where data will be written :offset (Number) - where to start writing in the buffer :length (Number) - how many bytes to read from fd :pos (Number|Bigint) - Where to begin reading. if -1 reads from current-pos @return {!Number} number of bytes read
Synchronously read data from the fd into the specified buffer {@link https://nodejs.org/api/fs.html#fsreadsyncfd-buffer-offset-length-position} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - where data will be written :offset (Number) - where to start writing in the buffer :length (Number) - how many bytes to read from fd :pos (Number|Bigint) - Where to begin reading. if -1 reads from current-pos @return {!Number} number of bytes read
(read-file pathstr enc)
@param {!string} pathstr :: the file path to read @param {!string} enc :: encoding , if "" (an explicit empty string), => raw buffer @return {(buffer.Buffer|string)}
@param {!string} pathstr :: the file path to read @param {!string} enc :: encoding , if "" (an explicit empty string), => raw buffer @return {(buffer.Buffer|string)}
(readable? pathstr)
Synchronously test if a file is readable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process read permission @return {!boolean}
Synchronously test if a file is readable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process read permission @return {!boolean}
(readdir dirpath)
(readdir dirpath opts)
Synchronously reads directory content {@link https://nodejs.org/api/fs.html#fsreaddirsyncpath-options} @param {!(string|Buffer|URL)} dirpath :: directory path to read @param {?IMap} opts :: options :encoding (string) -> defaults to 'utf8' :withFileTypes (bool) -> return fs.Dirent objects instead of strings. see {@link https://nodejs.org/api/fs.html#class-fsdirent} @return {!IVector} Vector<strings> representing directory content
Synchronously reads directory content {@link https://nodejs.org/api/fs.html#fsreaddirsyncpath-options} @param {!(string|Buffer|URL)} dirpath :: directory path to read @param {?IMap} opts :: options :encoding (string) -> defaults to 'utf8' :withFileTypes (bool) -> return fs.Dirent objects instead of strings. see {@link https://nodejs.org/api/fs.html#class-fsdirent} @return {!IVector} Vector<strings> representing directory content
(readline pathstr)
A simple file line reader. @param {!string} pathstr @return {!Channel} chan receiving [?err ?line] until file is consumed, and then the channel closes.
A simple file line reader. @param {!string} pathstr @return {!Channel} chan receiving [?err ?line] until file is consumed, and then the channel closes.
(readlink pathstr)
Synchronous readlink. Reads the contents of the symbolic link referred to by path. {@link https://nodejs.org/api/fs.html#fsreadlinksyncpath-options} @param {!(string|Buffer|URL)} pathstr :: the symbolic link to read @return {!string} the symbolic link's string value
Synchronous readlink. Reads the contents of the symbolic link referred to by path. {@link https://nodejs.org/api/fs.html#fsreadlinksyncpath-options} @param {!(string|Buffer|URL)} pathstr :: the symbolic link to read @return {!string} the symbolic link's string value
(realpath pathstr)
Synchronous realpath Computes the canonical pathname by resolving ., .., and symbolic links. {@link https://nodejs.org/api/fs.html#fsrealpathsyncpath-options} @param {!(string|Buffer|URL)} pathstr @return {!string} resolved path
Synchronous realpath Computes the canonical pathname by resolving ., .., and symbolic links. {@link https://nodejs.org/api/fs.html#fsrealpathsyncpath-options} @param {!(string|Buffer|URL)} pathstr @return {!string} resolved path
(rename oldpathstr newpathstr)
Synchronously rename a file. {@link https://nodejs.org/api/fs.html#fsrenamesyncoldpath-newpath} @param {!(string|Buffer|URL)} oldpathstr :: file to rename @param {!(string|Buffer|URL)} newpathstr :: what to rename it to @return {nil}
Synchronously rename a file. {@link https://nodejs.org/api/fs.html#fsrenamesyncoldpath-newpath} @param {!(string|Buffer|URL)} oldpathstr :: file to rename @param {!(string|Buffer|URL)} newpathstr :: what to rename it to @return {nil}
(rm pathstr)
Synchronously delete the file or directory path @param {!string} pathstr :: can be file or directory @return {nil}
Synchronously delete the file or directory path @param {!string} pathstr :: can be file or directory @return {nil}
(rm-f pathstr)
Synchronously delete the file or directory path Ignores paths that do not exist. @param {!string} pathstr :: can be file or directory @return {nil}
Synchronously delete the file or directory path Ignores paths that do not exist. @param {!string} pathstr :: can be file or directory @return {nil}
(rm-r pathstr)
Synchronous recursive delete. Throws when doesnt exist @param {!(string|Buffer|URL)} pathstr :: file/dir to recursively delete. @return {nil}
Synchronous recursive delete. Throws when doesnt exist @param {!(string|Buffer|URL)} pathstr :: file/dir to recursively delete. @return {nil}
(rm-rf pathstr)
Synchronous recursive delete. Ignores paths that do not exist. @param {!(string|Buffer|URL)} pathstr :: file/dir to recursively delete. @return {nil}
Synchronous recursive delete. Ignores paths that do not exist. @param {!(string|Buffer|URL)} pathstr :: file/dir to recursively delete. @return {nil}
(rmdir pathstr)
(rmdir pathstr opts)
Synchronously remove a directory. {@link https://nodejs.org/api/fs.html#fsrmdirsyncpath-options} @param {!(string|Buffer|URL)} pathstr :: path of directory to remove @param {?IMap} opts :maxRetries (number) :retryDelay (number) @return {nil}
Synchronously remove a directory. {@link https://nodejs.org/api/fs.html#fsrmdirsyncpath-options} @param {!(string|Buffer|URL)} pathstr :: path of directory to remove @param {?IMap} opts :maxRetries (number) :retryDelay (number) @return {nil}
(stat pathstr)
Synchronous stat @param {!(string|Buffer|URL)} pathstring @return {!IMap} file stats object converted to edn
Synchronous stat @param {!(string|Buffer|URL)} pathstring @return {!IMap} file stats object converted to edn
(symlink target pathstr)
(symlink target pathstr link_type)
Synchronous symlink. {@link https://nodejs.org/api/fs.html#fssymlinksynctarget-path-type} @param {!(string|Buffer|URL)} target :: what gets pointed to @param {!(string|Buffer|URL)} pathstr :: the new symbolic link that points to target @param {?string} link_type ::'file' or 'dir' @return {nil}
Synchronous symlink. {@link https://nodejs.org/api/fs.html#fssymlinksynctarget-path-type} @param {!(string|Buffer|URL)} target :: what gets pointed to @param {!(string|Buffer|URL)} pathstr :: the new symbolic link that points to target @param {?string} link_type ::'file' or 'dir' @return {nil}
(symlink? pathstr)
Synchronous test for symbolic link @param {!(string|Buffer|URL)} pathstr :: path to test @return {!boolean}
Synchronous test for symbolic link @param {!(string|Buffer|URL)} pathstr :: path to test @return {!boolean}
(touch pathstr)
Creates a file if non-existent @param {!string} pathstr @return {nil}
Creates a file if non-existent @param {!string} pathstr @return {nil}
(truncate pathstr)
(truncate pathstr length)
Synchronous truncate {@link https://nodejs.org/api/fs.html#fstruncatesyncpath-len} @param {!(string|Buffer|URL)} pathstr @param {?number} length @return {nil}
Synchronous truncate {@link https://nodejs.org/api/fs.html#fstruncatesyncpath-len} @param {!(string|Buffer|URL)} pathstr @param {?number} length @return {nil}
(unlink pathstr)
Synchronously unlink a file. {@link https://nodejs.org/api/fs.html#fsunlinksyncpath} @param {!(string|Buffer|URL)} pathstr :: path of file to unlink @return {nil}
Synchronously unlink a file. {@link https://nodejs.org/api/fs.html#fsunlinksyncpath} @param {!(string|Buffer|URL)} pathstr :: path of file to unlink @return {nil}
(unwatchFile pathstr)
remove all watchers from a file @param {!string} pathstr @return {nil}
remove all watchers from a file @param {!string} pathstr @return {nil}
(utimes pathstr atime mtime)
synchronous utimes Change the file system timestamps of the object referenced by path.
synchronous utimes Change the file system timestamps of the object referenced by path. - If the value is NaN or Infinity, the value would get converted to Date.now() - numerable strings ie '12235' are converted to numbers {@link https://nodejs.org/api/fs.html#fsutimessyncpath-atime-mtime} @param {!(string|Buffer|URL)} pathstr @param {(string|Number)} atime @param {(string|Number)} mtime @return {nil}
(watch filename)
(watch filename opts)
Watch a file or directory. Make note of caveats https://nodejs.org/api/fs.html#fs_caveats events : 'rename', 'change' , 'error', 'close' opts : :peristent {boolean} (true) :: whether the process should continue as long as files are being watched. :recursive {boolean} (false) :: watch subdirectories :buf-or-n {(impl/Buffer|number)} (10) :: channel buffer :encoding {string} ('utf8') :: used to interpret passed filename @return {!Watcher}
Watch a file or directory. Make note of caveats https://nodejs.org/api/fs.html#fs_caveats events : 'rename', 'change' , 'error', 'close' opts : :peristent {boolean} (true) :: whether the process should continue as long as files are being watched. :recursive {boolean} (false) :: watch subdirectories :buf-or-n {(impl/Buffer|number)} (10) :: channel buffer :encoding {string} ('utf8') :: used to interpret passed filename @return {!Watcher}
(watcher->ch FSWatcher out-ch)
(watcher->ch FSWatcher out-ch {:keys [key buf-or-n] :or {buf-or-n 10}})
(watchFile filename)
(watchFile filename opts)
Prefer watch. Polls files and returns stat objects. Opts: :peristent {boolean} (true) :: whether the process should continue as long as files are being watched. :interval {number} (5007) :: polling interval in msecs :buf-or-n {(impl/Buffer|number)} (10) :: channel buffer @return {!Channel} yielding [filename [current fs.stat, previous fs.stat]]
Prefer watch. Polls files and returns stat objects. Opts: :peristent {boolean} (true) :: whether the process should continue as long as files are being watched. :interval {number} (5007) :: polling interval in msecs :buf-or-n {(impl/Buffer|number)} (10) :: channel buffer @return {!Channel} yielding [filename [current fs.stat, previous fs.stat]]
(writable? pathstr)
Synchronously test if a file is writable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process write permission @return {!boolean}
Synchronously test if a file is writable to the process @param {!(string|Buffer|URL)} pathstr :: path to test for process write permission @return {!boolean}
(write fd opts)
(write fd buffer opts)
(write fd buffer offset length position)
Synchronously write data from the buffer to the fd {@link https://nodejs.org/api/fs.html#fswritesyncfd-buffer-offset-length-position} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - data to be written :offset (Number) - where to start reading in the buffer :length (Number) - how many bytes to read :pos (Number|Bigint) - where to begin writing in the fd @return {!Number} number of bytes written
Synchronously write data from the buffer to the fd {@link https://nodejs.org/api/fs.html#fswritesyncfd-buffer-offset-length-position} Can pass arguments individually or as a map: :buffer (Buffer|ArrayBuffer) - data to be written :offset (Number) - where to start reading in the buffer :length (Number) - how many bytes to read :pos (Number|Bigint) - where to begin writing in the fd @return {!Number} number of bytes written
(write-file pathstr content opts)
synchronously writes content to file represented by pathstring. @param {!string} pathstr :: file to write to @param {(string|buffer.Buffer)} content :: if buffer, :encoding is ignored @param {?IMap} opts: :encoding {string} - defaults to utf8. use :append {bool} - add content to existing file. :flags {string} - overrides :append when set :mode {int} - set on newly created files @return {nil}
synchronously writes content to file represented by pathstring. @param {!string} pathstr :: file to write to @param {(string|buffer.Buffer)} content :: if buffer, :encoding is ignored @param {?IMap} opts: :encoding {string} - defaults to utf8. use :append {bool} - add content to existing file. :flags {string} - overrides :append when set :mode {int} - set on newly created files @return {nil}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close