GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [v10.x] Backport pending pull requests by targos · Pull Request #21172 · nodejs/node

[v10.x] Backport pending pull requests #21172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
targos wants to merge 14 commits into nodejs:v10.x-staging from targos:backport-process-methods

Uh oh!

There was an error while loading. Please reload this page.

Closed

[v10.x] Backport pending pull requests #21172

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
0577312
fs: don't limit ftruncate() length to 32 bits
cjihrig May 20, 2018
39df351
process: backport process/methods file
targos Jun 6, 2018
748ca53
lib: mask mode_t type of arguments with 0o777
joyeecheung May 9, 2018
57a11af
doc: document file mode caveats on Windows
joyeecheung May 9, 2018
f6ab989
fs: drop duplicate API in promises mode
ChALkeR May 6, 2018
436cf2d
lib: support ranges in validateInt32()
cjihrig May 20, 2018
c6e9e54
fs: improve fchmod{Sync} validation
cjihrig May 20, 2018
b50c42e
fs: refactor fs module
jasnell May 15, 2018
f4287e6
test: increase coverage for fs.promises.truncate
May 9, 2018
c13cd35
src: refactor bootstrap to use bootstrap object
jasnell May 23, 2018
1bdc06b
doc: fix inconsistent documentation (host vs hostname)
davisokoth May 24, 2018
633b24d
lib: unmask mode_t values with 0o777
joyeecheung May 26, 2018
d2ad241
fs: do not crash when using a closed fs event watcher
joyeecheung May 26, 2018
a20498a
async_hooks: remove deprecated example
mafintosh May 28, 2018
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

6 changes: 3 additions & 3 deletions 6 benchmark/fs/bench-stat-promise.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ const bench = common.createBenchmark(main, {
});

async function run(n, statType) {
const arg = statType === 'fstat' ?
await fsPromises.open(__filename, 'r') : __filename;
const handleMode = statType === 'fstat';
const arg = handleMode ? await fsPromises.open(__filename, 'r') : __filename;
let remaining = n;
bench.start();
while (remaining-- > 0)
await fsPromises[statType](arg);
await (handleMode ? arg.stat() : fsPromises[statType](arg));
bench.end(n);

if (typeof arg.close === 'function')
Expand Down
8 changes: 0 additions & 8 deletions 8 doc/api/async_hooks.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -615,14 +615,6 @@ asyncResource.asyncId();

// Return the trigger ID for the AsyncResource instance.
asyncResource.triggerAsyncId();

// Call AsyncHooks before callbacks.
// Deprecated: Use asyncResource.runInAsyncScope instead.
asyncResource.emitBefore();

// Call AsyncHooks after callbacks.
// Deprecated: Use asyncResource.runInAsyncScope instead.
asyncResource.emitAfter();
```

#### new AsyncResource(type[, options])
Expand Down
207 changes: 18 additions & 189 deletions 207 doc/api/fs.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ fs.watch('./tmp', { encoding: 'buffer' }, (eventType, filename) => {
added: v10.0.0
-->

Emitted when the watcher stops watching for changes.
Emitted when the watcher stops watching for changes. The closed
`fs.FSWatcher` object is no longer usable in the event handler.

### Event: 'error'
<!-- YAML
Expand All @@ -334,7 +335,8 @@ added: v0.5.8

* `error` {Error}

Emitted when an error occurs while watching the file.
Emitted when an error occurs while watching the file. The errored
`fs.FSWatcher` object is no longer usable in the event handler.

### watcher.close()
<!-- YAML
Expand Down Expand Up @@ -1089,6 +1091,16 @@ For example, the octal value `0o765` means:
* The group may read and write the file.
* Others may read and execute the file.

Note: When using raw numbers where file modes are expected,
any value larger than `0o777` may result in platform-specific
behaviors that are not supported to work consistently.
Therefore constants like `S_ISVTX`, `S_ISGID` or `S_ISUID` are
not exposed in `fs.constants`.

Caveats: on Windows only the write permission can be changed, and the
distinction among the permissions of group, owner or others is not
implemented.

## fs.chmodSync(path, mode)
<!-- YAML
added: v0.6.7
Expand Down Expand Up @@ -1987,7 +1999,7 @@ changes:
-->

* `path` {string|Buffer|URL}
* `mode` {integer} **Default:** `0o777`
* `mode` {integer} Not supported on Windows. **Default:** `0o777`.
* `callback` {Function}
* `err` {Error}

Expand All @@ -2007,7 +2019,7 @@ changes:
-->

* `path` {string|Buffer|URL}
* `mode` {integer} **Default:** `0o777`
* `mode` {integer} Not supported on Windows. **Default:** `0o777`.

Synchronously creates a directory. Returns `undefined`.
This is the synchronous version of [`fs.mkdir()`][].
Expand Down Expand Up @@ -2127,7 +2139,8 @@ changes:
Asynchronous file open. See open(2).

`mode` sets the file mode (permission and sticky bits), but only if the file was
created.
created. Note that on Windows only the write permission can be manipulated,
see [`fs.chmod()`][].

The callback gets two arguments `(err, fd)`.

Expand Down Expand Up @@ -3795,128 +3808,6 @@ fsPromises.copyFile('source.txt', 'destination.txt', COPYFILE_EXCL)
.catch(() => console.log('The file could not be copied'));
```

### fsPromises.fchmod(filehandle, mode)
<!-- YAML
added: v10.0.0
-->

* `filehandle` {FileHandle}
* `mode` {integer}
* Returns: {Promise}

Asynchronous fchmod(2). The `Promise` is resolved with no arguments upon
success.

### fsPromises.fchown(filehandle, uid, gid)
<!-- YAML
added: v10.0.0
-->

* `filehandle` {FileHandle}
* `uid` {integer}
* `gid` {integer}
* Returns: {Promise}

Changes the ownership of the file represented by `filehandle` then resolves
the `Promise` with no arguments upon success.

### fsPromises.fdatasync(filehandle)
<!-- YAML
added: v10.0.0
-->

* `filehandle` {FileHandle}
* Returns: {Promise}

Asynchronous fdatasync(2). The `Promise` is resolved with no arguments upon
success.

### fsPromises.fstat(filehandle)
<!-- YAML
added: v10.0.0
-->

* `filehandle` {FileHandle}
* Returns: {Promise}

Retrieves the [`fs.Stats`][] for the given `filehandle`.

### fsPromises.fsync(filehandle)
<!-- YAML
added: v10.0.0
-->

* `filehandle` {FileHandle}
* Returns: {Promise}

Asynchronous fsync(2). The `Promise` is resolved with no arguments upon
success.

### fsPromises.ftruncate(filehandle[, len])
<!-- YAML
added: v10.0.0
-->

* `filehandle` {FileHandle}
* `len` {integer} **Default:** `0`
* Returns: {Promise}

Truncates the file represented by `filehandle` then resolves the `Promise`
with no arguments upon success.

If the file referred to by the `FileHandle` was larger than `len` bytes, only
the first `len` bytes will be retained in the file.

For example, the following program retains only the first four bytes of the
file:

```js
console.log(fs.readFileSync('temp.txt', 'utf8'));
// Prints: Node.js

async function doTruncate() {
const fd = await fsPromises.open('temp.txt', 'r+');
await fsPromises.ftruncate(fd, 4);
console.log(fs.readFileSync('temp.txt', 'utf8')); // Prints: Node
}

doTruncate().catch(console.error);
```

If the file previously was shorter than `len` bytes, it is extended, and the
extended part is filled with null bytes (`'\0'`). For example,

```js
console.log(fs.readFileSync('temp.txt', 'utf8'));
// Prints: Node.js

async function doTruncate() {
const fd = await fsPromises.open('temp.txt', 'r+');
await fsPromises.ftruncate(fd, 10);
console.log(fs.readFileSync('temp.txt', 'utf8')); // Prints Node.js\0\0\0
}

doTruncate().catch(console.error);
```

The last three bytes are null bytes (`'\0'`), to compensate the over-truncation.

### fsPromises.futimes(filehandle, atime, mtime)
<!-- YAML
added: v10.0.0
-->

* `filehandle` {FileHandle}
* `atime` {number|string|Date}
* `mtime` {number|string|Date}
* Returns: {Promise}

Change the file system timestamps of the object referenced by the supplied
`FileHandle` then resolves the `Promise` with no arguments upon success.

This function does not work on AIX versions before 7.1, it will resolve the
`Promise` with an error using code `UV_ENOSYS`.

### fsPromises.lchmod(path, mode)
<!-- YAML
deprecated: v10.0.0
Expand Down Expand Up @@ -4025,35 +3916,6 @@ by [Naming Files, Paths, and Namespaces][]. Under NTFS, if the filename contains
a colon, Node.js will open a file system stream, as described by
[this MSDN page][MSDN-Using-Streams].

### fsPromises.read(filehandle, buffer, offset, length, position)
<!-- YAML
added: v10.0.0
-->

* `filehandle` {FileHandle}
* `buffer` {Buffer|Uint8Array}
* `offset` {integer}
* `length` {integer}
* `position` {integer}
* Returns: {Promise}

Read data from the file specified by `filehandle`.

`buffer` is the buffer that the data will be written to.

`offset` is the offset in the buffer to start writing at.

`length` is an integer specifying the number of bytes to read.

`position` is an argument specifying where to begin reading from in the file.
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 remain unchanged.

Following successful read, the `Promise` is resolved with an object with a
`bytesRead` property specifying the number of bytes read, and a `buffer`
property that is a reference to the passed in `buffer` argument.

### fsPromises.readdir(path[, options])
<!-- YAML
added: v10.0.0
Expand Down Expand Up @@ -4238,39 +4100,6 @@ The `atime` and `mtime` arguments follow these rules:
- If the value can not be converted to a number, or is `NaN`, `Infinity` or
`-Infinity`, an `Error` will be thrown.

### fsPromises.write(filehandle, buffer[, offset[, length[, position]]])
<!-- YAML
added: v10.0.0
-->

* `filehandle` {FileHandle}
* `buffer` {Buffer|Uint8Array}
* `offset` {integer}
* `length` {integer}
* `position` {integer}
* Returns: {Promise}

Write `buffer` to the file specified by `filehandle`.

The `Promise` is resolved with an object containing a `bytesWritten` property
identifying the number of bytes written, and a `buffer` property containing
a reference to the `buffer` written.

`offset` determines the part of the buffer to be written, and `length` is
an integer specifying the number of bytes to write.

`position` refers to the offset from the beginning of the file where this data
should be written. If `typeof position !== 'number'`, the data will be written
at the current position. See pwrite(2).

It is unsafe to use `fsPromises.write()` multiple times on the same file
without waiting for the `Promise` to be resolved (or rejected). For this
scenario, `fs.createWriteStream` is strongly recommended.

On Linux, positional writes do not work when the file is opened in append mode.
The kernel ignores the position argument and always appends the data to
the end of the file.

### fsPromises.writeFile(file, data[, options])
<!-- YAML
added: v10.0.0
Expand Down
8 changes: 4 additions & 4 deletions 8 doc/api/tls.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ added: v0.5.3
`cert`, `ca`, etc).

The `server.addContext()` method adds a secure context that will be used if
the client request's SNI hostname matches the supplied `hostname` (or wildcard).
the client request's SNI name matches the supplied `hostname` (or wildcard).

### server.address()
<!-- YAML
Expand Down Expand Up @@ -796,17 +796,17 @@ and their processing can be delayed due to packet loss or reordering. However,
smaller fragments add extra TLS framing bytes and CPU overhead, which may
decrease overall server throughput.

## tls.checkServerIdentity(host, cert)
## tls.checkServerIdentity(hostname, cert)
<!-- YAML
added: v0.8.4
-->

* `host` {string} The hostname to verify the certificate against
* `hostname` {string} The hostname to verify the certificate against
* `cert` {Object} An object representing the peer's certificate. The returned
object has some properties corresponding to the fields of the certificate.
* Returns: {Error|undefined}

Verifies the certificate `cert` is issued to host `host`.
Verifies the certificate `cert` is issued to `hostname`.

Returns {Error} object, populating it with the reason, host, and cert on
failure. On success, returns {undefined}.
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.