Version
main
Platform
Subsystem
vfs
What steps will reproduce the bug?
import fs from 'node:fs/promises';
import path from 'node:path';
import vfs from 'node:vfs';
const virtualFs = vfs.create();
const mountPoint = virtualFs.mount();
try {
console.log(await fs.statfs(path.join(mountPoint, 'missing')));
} finally {
virtualFs.unmount();
}
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
fs.statfs() should reject with ENOENT, matching its behavior for nonexistent paths on the native filesystem.
What do you see instead?
fs.statfs() resolves with a synthetic VFS filesystem-statistics object even though the requested path does not exist.
Additional information
fs equivalent
import fs from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
const directory = await fs.mkdtemp(path.join(os.tmpdir(), 'statfs-'));
try {
console.log(await fs.statfs(path.join(directory, 'missing')));
} finally {
await fs.rm(directory, { recursive: true, force: true });
}
This rejects with an ENOENT error.
Version
main
Platform
Subsystem
vfs
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
fs.statfs()should reject withENOENT, matching its behavior for nonexistent paths on the native filesystem.What do you see instead?
fs.statfs()resolves with a synthetic VFS filesystem-statistics object even though the requested path does not exist.Additional information
fs equivalent
This rejects with an
ENOENTerror.