# HG changeset patch # User Yaroslav Zhuravlev # Date 1640776029 -10800 # Node ID 2594d336342d2030fbbf1841cce784c55a2cdfee # Parent d84856836c20579912476b2f1765eb1e37f3cd03 Documented fs.Stats, statSync and lstatSync in njs. diff -r d84856836c20 -r 2594d336342d xml/en/docs/njs/reference.xml --- a/xml/en/docs/njs/reference.xml Tue Dec 28 19:23:21 2021 +0300 +++ b/xml/en/docs/njs/reference.xml Wed Dec 29 14:07:09 2021 +0300 @@ -9,7 +9,7 @@
+ rev="79">
@@ -3316,6 +3316,26 @@ +lstatSync(path[, +options]) + +Synchronously retrieves +the fs.Stats object +for the symbolic link referred to by path +(0.7.1). +The options parameter is expected to be +an object with the following keys: + +throwIfNoEntry + +a boolean value which indicates +whether an exception is thrown if no file system entry exists, +rather than returning undefined, +by default is false. + + + + mkdirSync(path[, options]) @@ -3443,6 +3463,29 @@ (0.4.2). +statSync(path,[ +options]) + +Synchronously retrieves +the fs.Stats object +for the specified path +(0.7.1). +The path can be a +string or +buffer. +The options parameter is expected to be +an object with the following keys: + +throwIfNoEntry + +a boolean value which indicates whether +an exception is thrown if no file system entry exists +rather than returning undefined, +by default is true. + + + + symlinkSync(target, path) @@ -3563,6 +3606,152 @@
+
+ + +The fs.Stats object provides information about a file. +The object is returned from +fs.statSync() and +fs.lstatSync(). + + + + +stats.isBlockDevice()—returns +true if the fs.Stats object describes +a block device. + + + +stats.isDirectory()—returns +true if the fs.Stats object describes +a file system directory. + + + +stats.isFIFO()—returns +true if the fs.Stats object describes +a first-in-first-out (FIFO) pipe. + + + +stats.isFile()—returns +true if the fs.Stats object describes +a regular file. + + + +stats.isSocket()—returns +true if the fs.Stats object describes +a socket. + + + +stats.isSymbolicLink()—returns +true if the fs.Stats object describes +a symbolic link. + + + +stats.dev— +the numeric identifier of the device containing the file. + + + +stats.ino— +the file system specific Inode number for the file. + + + +stats.mode— +a bit-field describing the file type and mode. + + + +stats.nlink— +the number of hard-links that exist for the file. + + + +stats.uid— +the numeric user identifier of the user that owns the file (POSIX). + + + +stats.gid— +the numeric group identifier of the group that owns the file (POSIX). + + + +stats.rdev— +the numeric device identifier if the file represents a device. + + + +stats.size— +the size of the file in bytes. + + + +stats.blksize— +the file system block size for i/o operations. + + + +stats.blocks— +the number of blocks allocated for this file. + + + +stats.atimeMs— +the timestamp indicating the last time this file was accessed expressed +in milliseconds since the POSIX Epoch. + + + +stats.mtimeMs— +the timestamp indicating the last time this file was modified expressed +in milliseconds since the POSIX Epoch. + + + +stats.ctimeMs— +the timestamp indicating the last time this file was changed expressed +in milliseconds since the POSIX Epoch. + + + +stats.birthtimeMs— +the timestamp indicating the creation time of this file expressed +in milliseconds since the POSIX Epoch. + + + +stats.atime— +the timestamp indicating the last time this file was accessed. + + + +stats.mtime— +the timestamp indicating the last time this file was modified. + + + +stats.ctime— +the timestamp indicating the last time this file was changed. + + + +stats.birthtime— +the timestamp indicating the creation time of this file. + + + + + +
+ +