# HG changeset patch # User Yaroslav Zhuravlev # Date 1698085408 -3600 # Node ID 61996cb486f91e693115311c0570996972c252cb # Parent 7f8bedbdbe4f20777813de81d2ea133ff79a1ec9 Reordered and added to toc fs methods in njs Reference. diff --git a/xml/en/docs/njs/reference.xml b/xml/en/docs/njs/reference.xml --- a/xml/en/docs/njs/reference.xml +++ b/xml/en/docs/njs/reference.xml @@ -9,7 +9,7 @@
+ rev="119">
@@ -4867,18 +4867,28 @@ undefined fs.mkdirSync() fs.openSync() fs.promises.open() -fs.readSync() fs.readdirSync() fs.readFileSync() +fs.readSync() fs.realpathSync() fs.renameSync() fs.rmdirSync() fs.statSync() fs.symlinkSync() +fs.unlinkSync() +fs.writeFileSync() fs.writeSync() fs.writeSync() -fs.unlinkSync() -fs.writeFileSync() + + + + + + + + + +
fs.Dirent
fs.FileHandle
fs.Stats
File Access Constants
File System Flags
@@ -5045,53 +5055,6 @@ mode option, by default is 0o66 -readSync(fd, -buffer, offset[, -length[, position]]) - -Reads the content of a file path using file descriptor fd, -returns the number of bytes read -(0.7.7). - - - -buffer - -the buffer value can be a -Buffer, -TypedArray, or -DataView - - -offset - -is an integer representing -the position in buffer to write the data to - - -length - -is an integer representing -the number of bytes to read - - -position - -specifies where to begin reading from in the file, -the value can be -integer or -null, -by default is null. -If position is null, -data will be read from the current file position, -and the file position will be updated. -If position is an integer, -the file position will be unchanged - - - - - readdirSync(path[, options]) @@ -5168,6 +5131,53 @@ true +readSync(fd, +buffer, offset[, +length[, position]]) + +Reads the content of a file path using file descriptor fd, +returns the number of bytes read +(0.7.7). + + + +buffer + +the buffer value can be a +Buffer, +TypedArray, or +DataView + + +offset + +is an integer representing +the position in buffer to write the data to + + +length + +is an integer representing +the number of bytes to read + + +position + +specifies where to begin reading from in the file, +the value can be +integer or +null, +by default is null. +If position is null, +data will be read from the current file position, +and the file position will be updated. +If position is an integer, +the file position will be unchanged + + + + + realpathSync(path[, options]) @@ -5233,6 +5243,45 @@ pointing to target us Relative targets are relative to the link’s parent directory. +unlinkSync(path) + +Synchronously unlinks a file by path +(0.3.9). + + +writeFileSync(filename, +data[, +options]) + +Synchronously writes data to a file +with provided filename. +The data is expected to be a string +or a Buffer object (0.4.4). +If the file does not exist, it will be created, +if the file exists, it will be replaced. +The options parameter is expected to be +an object with the following keys: + +mode + +mode option, by default is 0o666 + + +flag + +file system flag, +by default is w + + + + +>> var fs = require('fs') +undefined +>> var file = fs.writeFileSync('hello.txt', 'Hello world') +undefined + + + writeSync(fd, buffer, offset[, length[, position]]) @@ -5322,45 +5371,6 @@ by default is utf8 -unlinkSync(path) - -Synchronously unlinks a file by path -(0.3.9). - - -writeFileSync(filename, -data[, -options]) - -Synchronously writes data to a file -with provided filename. -The data is expected to be a string -or a Buffer object (0.4.4). -If the file does not exist, it will be created, -if the file exists, it will be replaced. -The options parameter is expected to be -an object with the following keys: - -mode - -mode option, by default is 0o666 - - -flag - -file system flag, -by default is w - - - - ->> var fs = require('fs') -undefined ->> var file = fs.writeFileSync('hello.txt', 'Hello world') -undefined - - -