ServerJS/API/file: Difference between revisions

Jump to navigation Jump to search
m
→‎Tier 1: removed symlink variants for tier 1
(Added a proposal for a tier1 specification of the File API)
m (→‎Tier 1: removed symlink variants for tier 1)
Line 12: Line 12:


* exists(path): whether a file exists at a given path: receives a path and returns whether that path, joined on the current working directory, corresponds to a file that exists.  If the file is a broken symbolic link, returns false.
* exists(path): whether a file exists at a given path: receives a path and returns whether that path, joined on the current working directory, corresponds to a file that exists.  If the file is a broken symbolic link, returns false.
* existsLink(path): whether a symbolic link or file exists at a given path: receives a path and returns whether that path, joined on the current working directory, corresponds to a file, albeit a broken symbolic link, that exists.


* stat(path): returns an object that represents a snapshot of the information about given file.
* stat(path): returns an object that represents a snapshot of the information about given file.
Line 21: Line 19:
*# The path is resolved relative to the current working directory.
*# The path is resolved relative to the current working directory.
*# Throws an error if the corresponding file does not exist or is inaccessible.
*# Throws an error if the corresponding file does not exist or is inaccessible.
* statLink(path): returns the same object as stat, except for the symbolic link at the end of the path, if it is a symbolic link.


* list(path): returns a traversable, indexable representation of the names of files in a particular directory.
* list(path): returns a traversable, indexable representation of the names of files in a particular directory.
171

edits

Navigation menu