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 — fs: fix fsPromises.lchmod error on non-Mac · nodejs/node@b758006

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/fs
    • promises.js
  • test/parallel
    • test-fs-promises.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/fs/promises.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/promises.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ async function chmod(path, mode) {
371371

372372
async function lchmod(path, mode) {
373373
if (O_SYMLINK === undefined)
374-
throw new ERR_METHOD_NOT_IMPLEMENTED();
374+
throw new ERR_METHOD_NOT_IMPLEMENTED('lchmod()');
375375

376376
const fd = await open(path, O_WRONLY | O_SYMLINK);
377377
return fchmod(fd, mode).finally(fd.close.bind(fd));
Collapse file

‎test/parallel/test-fs-promises.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises.js
+13-2Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,26 @@ function verifyStatObject(stat) {
140140
(await realpath(newLink)).toLowerCase());
141141
assert.strictEqual(newPath.toLowerCase(),
142142
(await readlink(newLink)).toLowerCase());
143+
144+
const newMode = 0o666;
143145
if (common.isOSX) {
144146
// lchmod is only available on macOS
145-
const newMode = 0o666;
146147
await lchmod(newLink, newMode);
147148
stats = await lstat(newLink);
148149
assert.strictEqual(stats.mode & 0o777, newMode);
150+
} else {
151+
await Promise.all([
152+
assert.rejects(
153+
lchmod(newLink, newMode),
154+
common.expectsError({
155+
code: 'ERR_METHOD_NOT_IMPLEMENTED',
156+
type: Error,
157+
message: 'The lchmod() method is not implemented'
158+
})
159+
)
160+
]);
149161
}
150162

151-
152163
await unlink(newLink);
153164
}
154165

0 commit comments

Comments
0 (0)
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.