Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/api/vfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ signatures as their [`node:fs`][] counterparts:
* `linkSync(existingPath, newPath)`
* `chmodSync(path, mode)`
* `chownSync(path, uid, gid)`
* `lchownSync(path, uid, gid)`
* `utimesSync(path, atime, mtime)`
* `lutimesSync(path, atime, mtime)`
* `mkdtempSync(prefix)`
Expand Down
7 changes: 6 additions & 1 deletion lib/internal/vfs/file_system.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,11 @@ class VirtualFileSystem {
this[kProvider].chownSync(providerPath, uid, gid);
}

lchownSync(filePath, uid, gid) {
const providerPath = this.#toProviderPath(filePath);
this[kProvider].lchownSync(providerPath, uid, gid);
}

utimesSync(filePath, atime, mtime) {
const providerPath = this.#toProviderPath(filePath);
this[kProvider].utimesSync(providerPath, atime, mtime);
Expand Down Expand Up @@ -1234,7 +1239,7 @@ class VirtualFileSystem {

async lchown(filePath, uid, gid) {
const providerPath = toProviderPath(filePath);
provider.chownSync(providerPath, uid, gid);
provider.lchownSync(providerPath, uid, gid);
},

async utimes(filePath, atime, mtime) {
Expand Down
11 changes: 11 additions & 0 deletions lib/internal/vfs/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,17 @@
throw new ERR_METHOD_NOT_IMPLEMENTED('renameSync');
}

/**

Check failure on line 238 in lib/internal/vfs/provider.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Missing JSDoc @returns declaration
* Changes ownership of a path without following the final symbolic link.
* Providers with symlink support should override this.
* @param {string} path The path
* @param {number} uid The user id
* @param {number} gid The group id
*/
lchownSync(path, uid, gid) {
return this.chownSync(path, uid, gid);
}

// === DEFAULT IMPLEMENTATIONS (built on primitives) ===

/**
Expand Down
7 changes: 7 additions & 0 deletions lib/internal/vfs/providers/memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,13 @@ class MemoryProvider extends VirtualProvider {
entry.ctime = DateNow();
}

lchownSync(path, uid, gid) {
const entry = this.#getEntry(path, 'chown', false);
if (uid >= 0) entry.uid = uid;
if (gid >= 0) entry.gid = gid;
entry.ctime = DateNow();
}

utimesSync(path, atime, mtime) {
const entry = this.#getEntry(path, 'utime', true);
entry.atime = toMs(atime);
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/vfs/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ function createVfsHandlers() {
vfsOpVoid(path, (vfs, n) => vfs.symlinkSync(target, n, type)),
chmodSync: (path, mode) => vfsOpVoid(path, (vfs, n) => vfs.chmodSync(n, mode)),
chownSync: (path, uid, gid) => vfsOpVoid(path, (vfs, n) => vfs.chownSync(n, uid, gid)),
lchownSync: (path, uid, gid) => vfsOpVoid(path, (vfs, n) => vfs.chownSync(n, uid, gid)),
lchownSync: (path, uid, gid) => vfsOpVoid(path, (vfs, n) => vfs.lchownSync(n, uid, gid)),
utimesSync: (path, atime, mtime) =>
vfsOpVoid(path, (vfs, n) => vfs.utimesSync(n, atime, mtime)),
lutimesSync: (path, atime, mtime) =>
Expand Down
48 changes: 48 additions & 0 deletions test/parallel/test-vfs-lchown-symlink.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Flags: --experimental-vfs
'use strict';

const common = require('../common');
const assert = require('assert');
const fs = require('fs');
const fsp = require('fs/promises');
const path = require('path');
const vfs = require('node:vfs');

const mountPoint = path.resolve('/tmp/vfs-lchown-' + process.pid);
const myVfs = vfs.create();
myVfs.writeFileSync('/sync-target.txt', 'target');
myVfs.symlinkSync('/sync-target.txt', '/sync-link.txt');
myVfs.writeFileSync('/async-target.txt', 'target');
myVfs.symlinkSync('/async-target.txt', '/async-link.txt');
myVfs.writeFileSync('/promise-target.txt', 'target');
myVfs.symlinkSync('/promise-target.txt', '/promise-link.txt');
myVfs.mount(mountPoint);

function assertOwnership(filePath, uid, gid) {
const stats = myVfs.lstatSync(filePath);

Check failure on line 22 in test/parallel/test-vfs-lchown-symlink.js

View workflow job for this annotation

GitHub Actions / test-macOS

--- stderr --- (node:76370) ExperimentalWarning: VirtualFileSystem is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created) node:internal/vfs/file_system:196 throw createENOENT('open', inputPath); ^ Error: ENOENT: no such file or directory, open '/sync-target.txt' at #toProviderPath (node:internal/vfs/file_system:196:15) at VirtualFileSystem.lstatSync (node:internal/vfs/file_system:250:46) at assertOwnership (/Users/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js:22:23) at /Users/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js:30:5 at Object.<anonymous> (/Users/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js:48:3) at Module._compile (node:internal/modules/cjs/loader:1937:14) at Object..js (node:internal/modules/cjs/loader:2077:10) at Module.load (node:internal/modules/cjs/loader:1659:32) at Module._load (node:internal/modules/cjs/loader:1451:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/sync-target.txt' } Node.js v27.0.0-pre Command: out/Release/node --experimental-vfs /Users/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js

Check failure on line 22 in test/parallel/test-vfs-lchown-symlink.js

View workflow job for this annotation

GitHub Actions / test-linux (ubuntu-24.04)

--- stderr --- (node:217128) ExperimentalWarning: VirtualFileSystem is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created) node:internal/vfs/file_system:196 throw createENOENT('open', inputPath); ^ Error: ENOENT: no such file or directory, open '/sync-target.txt' at #toProviderPath (node:internal/vfs/file_system:196:15) at VirtualFileSystem.lstatSync (node:internal/vfs/file_system:250:46) at assertOwnership (/home/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js:22:23) at /home/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js:30:5 at Object.<anonymous> (/home/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js:48:3) at Module._compile (node:internal/modules/cjs/loader:1937:14) at Object..js (node:internal/modules/cjs/loader:2077:10) at Module.load (node:internal/modules/cjs/loader:1659:32) at Module._load (node:internal/modules/cjs/loader:1451:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/sync-target.txt' } Node.js v27.0.0-pre Command: out/Release/node --experimental-vfs /home/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js

Check failure on line 22 in test/parallel/test-vfs-lchown-symlink.js

View workflow job for this annotation

GitHub Actions / test-linux (ubuntu-24.04-arm)

--- stderr --- (node:216730) ExperimentalWarning: VirtualFileSystem is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created) node:internal/vfs/file_system:196 throw createENOENT('open', inputPath); ^ Error: ENOENT: no such file or directory, open '/sync-target.txt' at #toProviderPath (node:internal/vfs/file_system:196:15) at VirtualFileSystem.lstatSync (node:internal/vfs/file_system:250:46) at assertOwnership (/home/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js:22:23) at /home/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js:30:5 at Object.<anonymous> (/home/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js:48:3) at Module._compile (node:internal/modules/cjs/loader:1937:14) at Object..js (node:internal/modules/cjs/loader:2077:10) at Module.load (node:internal/modules/cjs/loader:1659:32) at Module._load (node:internal/modules/cjs/loader:1451:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/sync-target.txt' } Node.js v27.0.0-pre Command: out/Release/node --experimental-vfs /home/runner/work/node/node/node/test/parallel/test-vfs-lchown-symlink.js

Check failure on line 22 in test/parallel/test-vfs-lchown-symlink.js

View workflow job for this annotation

GitHub Actions / aarch64-darwin: with shared libraries / build

--- stderr --- (node:66262) ExperimentalWarning: VirtualFileSystem is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created) node:internal/vfs/file_system:196 throw createENOENT('open', inputPath); ^ Error: ENOENT: no such file or directory, open '/sync-target.txt' at #toProviderPath (node:internal/vfs/file_system:196:15) at VirtualFileSystem.lstatSync (node:internal/vfs/file_system:250:46) at assertOwnership (/Users/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:22:23) at /Users/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:30:5 at Object.<anonymous> (/Users/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:48:3) at Module._compile (node:internal/modules/cjs/loader:1937:14) at Object..js (node:internal/modules/cjs/loader:2077:10) at Module.load (node:internal/modules/cjs/loader:1659:32) at Module._load (node:internal/modules/cjs/loader:1451:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/sync-target.txt' } Node.js v27.0.0-pre Command: out/Release/node --experimental-vfs /Users/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js

Check failure on line 22 in test/parallel/test-vfs-lchown-symlink.js

View workflow job for this annotation

GitHub Actions / x86_64-linux: with shared libraries / build

--- stderr --- (node:91769) ExperimentalWarning: VirtualFileSystem is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created) node:internal/vfs/file_system:196 throw createENOENT('open', inputPath); ^ Error: ENOENT: no such file or directory, open '/sync-target.txt' at #toProviderPath (node:internal/vfs/file_system:196:15) at VirtualFileSystem.lstatSync (node:internal/vfs/file_system:250:46) at assertOwnership (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:22:23) at /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:30:5 at Object.<anonymous> (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:48:3) at Module._compile (node:internal/modules/cjs/loader:1937:14) at Object..js (node:internal/modules/cjs/loader:2077:10) at Module.load (node:internal/modules/cjs/loader:1659:32) at Module._load (node:internal/modules/cjs/loader:1451:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/sync-target.txt' } Node.js v27.0.0-pre Command: out/Release/node --experimental-vfs /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js

Check failure on line 22 in test/parallel/test-vfs-lchown-symlink.js

View workflow job for this annotation

GitHub Actions / aarch64-linux: with shared openssl-3.6.3 / build

--- stderr --- (node:89995) ExperimentalWarning: VirtualFileSystem is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created) node:internal/vfs/file_system:196 throw createENOENT('open', inputPath); ^ Error: ENOENT: no such file or directory, open '/sync-target.txt' at #toProviderPath (node:internal/vfs/file_system:196:15) at VirtualFileSystem.lstatSync (node:internal/vfs/file_system:250:46) at assertOwnership (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:22:23) at /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:30:5 at Object.<anonymous> (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:48:3) at Module._compile (node:internal/modules/cjs/loader:1937:14) at Object..js (node:internal/modules/cjs/loader:2077:10) at Module.load (node:internal/modules/cjs/loader:1659:32) at Module._load (node:internal/modules/cjs/loader:1451:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/sync-target.txt' } Node.js v27.0.0-pre Command: out/Release/node --experimental-vfs /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js

Check failure on line 22 in test/parallel/test-vfs-lchown-symlink.js

View workflow job for this annotation

GitHub Actions / aarch64-linux: with shared openssl-3.0.21 / build

--- stderr --- (node:89207) ExperimentalWarning: VirtualFileSystem is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created) node:internal/vfs/file_system:196 throw createENOENT('open', inputPath); ^ Error: ENOENT: no such file or directory, open '/sync-target.txt' at #toProviderPath (node:internal/vfs/file_system:196:15) at VirtualFileSystem.lstatSync (node:internal/vfs/file_system:250:46) at assertOwnership (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:22:23) at /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:30:5 at Object.<anonymous> (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:48:3) at Module._compile (node:internal/modules/cjs/loader:1937:14) at Object..js (node:internal/modules/cjs/loader:2077:10) at Module.load (node:internal/modules/cjs/loader:1659:32) at Module._load (node:internal/modules/cjs/loader:1451:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/sync-target.txt' } Node.js v27.0.0-pre Command: out/Release/node --experimental-vfs /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js

Check failure on line 22 in test/parallel/test-vfs-lchown-symlink.js

View workflow job for this annotation

GitHub Actions / aarch64-linux: with shared openssl-1.1.1w / build

--- stderr --- (node:89219) ExperimentalWarning: VirtualFileSystem is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created) node:internal/vfs/file_system:196 throw createENOENT('open', inputPath); ^ Error: ENOENT: no such file or directory, open '/sync-target.txt' at #toProviderPath (node:internal/vfs/file_system:196:15) at VirtualFileSystem.lstatSync (node:internal/vfs/file_system:250:46) at assertOwnership (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:22:23) at /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:30:5 at Object.<anonymous> (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:48:3) at Module._compile (node:internal/modules/cjs/loader:1937:14) at Object..js (node:internal/modules/cjs/loader:2077:10) at Module.load (node:internal/modules/cjs/loader:1659:32) at Module._load (node:internal/modules/cjs/loader:1451:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/sync-target.txt' } Node.js v27.0.0-pre Command: out/Release/node --experimental-vfs /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js

Check failure on line 22 in test/parallel/test-vfs-lchown-symlink.js

View workflow job for this annotation

GitHub Actions / aarch64-linux: with shared boringssl-0.20260526.0 / build

--- stderr --- (node:89001) ExperimentalWarning: VirtualFileSystem is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created) node:internal/vfs/file_system:196 throw createENOENT('open', inputPath); ^ Error: ENOENT: no such file or directory, open '/sync-target.txt' at #toProviderPath (node:internal/vfs/file_system:196:15) at VirtualFileSystem.lstatSync (node:internal/vfs/file_system:250:46) at assertOwnership (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:22:23) at /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:30:5 at Object.<anonymous> (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:48:3) at Module._compile (node:internal/modules/cjs/loader:1937:14) at Object..js (node:internal/modules/cjs/loader:2077:10) at Module.load (node:internal/modules/cjs/loader:1659:32) at Module._load (node:internal/modules/cjs/loader:1451:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/sync-target.txt' } Node.js v27.0.0-pre Command: out/Release/node --experimental-vfs /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js

Check failure on line 22 in test/parallel/test-vfs-lchown-symlink.js

View workflow job for this annotation

GitHub Actions / aarch64-linux: with shared openssl-4.0.1 / build

--- stderr --- (node:89868) ExperimentalWarning: VirtualFileSystem is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created) node:internal/vfs/file_system:196 throw createENOENT('open', inputPath); ^ Error: ENOENT: no such file or directory, open '/sync-target.txt' at #toProviderPath (node:internal/vfs/file_system:196:15) at VirtualFileSystem.lstatSync (node:internal/vfs/file_system:250:46) at assertOwnership (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:22:23) at /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:30:5 at Object.<anonymous> (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:48:3) at Module._compile (node:internal/modules/cjs/loader:1937:14) at Object..js (node:internal/modules/cjs/loader:2077:10) at Module.load (node:internal/modules/cjs/loader:1659:32) at Module._load (node:internal/modules/cjs/loader:1451:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/sync-target.txt' } Node.js v27.0.0-pre Command: out/Release/node --experimental-vfs /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js

Check failure on line 22 in test/parallel/test-vfs-lchown-symlink.js

View workflow job for this annotation

GitHub Actions / aarch64-linux: with shared openssl-3.5.7 / build

--- stderr --- (node:89940) ExperimentalWarning: VirtualFileSystem is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created) node:internal/vfs/file_system:196 throw createENOENT('open', inputPath); ^ Error: ENOENT: no such file or directory, open '/sync-target.txt' at #toProviderPath (node:internal/vfs/file_system:196:15) at VirtualFileSystem.lstatSync (node:internal/vfs/file_system:250:46) at assertOwnership (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:22:23) at /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:30:5 at Object.<anonymous> (/home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js:48:3) at Module._compile (node:internal/modules/cjs/loader:1937:14) at Object..js (node:internal/modules/cjs/loader:2077:10) at Module.load (node:internal/modules/cjs/loader:1659:32) at Module._load (node:internal/modules/cjs/loader:1451:12) at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/sync-target.txt' } Node.js v27.0.0-pre Command: out/Release/node --experimental-vfs /home/runner/work/_temp/node-v27.0.0-nightly2026-07-18e8325e5aa5-slim/test/parallel/test-vfs-lchown-symlink.js
assert.strictEqual(stats.uid, uid);
assert.strictEqual(stats.gid, gid);
}

(async () => {
try {
fs.lchownSync(path.join(mountPoint, 'sync-link.txt'), 123, 456);
assertOwnership('/sync-target.txt', 0, 0);
assertOwnership('/sync-link.txt', 123, 456);

await new Promise((resolve, reject) => {
fs.lchown(path.join(mountPoint, 'async-link.txt'), 234, 567, (err) => {
if (err) reject(err);
else resolve();
});
});
assertOwnership('/async-target.txt', 0, 0);
assertOwnership('/async-link.txt', 234, 567);

await fsp.lchown(path.join(mountPoint, 'promise-link.txt'), 345, 678);
assertOwnership('/promise-target.txt', 0, 0);
assertOwnership('/promise-link.txt', 345, 678);
} finally {
myVfs.unmount();
}
})().then(common.mustCall());
Loading