Version
main
Platform
Subsystem
vfs
What steps will reproduce the bug?
importfsfrom'node:fs';importosfrom'node:os';importpathfrom'node:path';importvfsfrom'node:vfs';constrealRoot=fs.mkdtempSync(path.join(os.tmpdir(),'vfs-real-root-'));constmountPoint=fs.mkdtempSync(path.join(os.tmpdir(),'vfs-mount-'));constmounted=vfs.create(newvfs.RealFSProvider(realRoot),{emitExperimentalWarning: false}).mount(mountPoint);try{fs.writeFileSync(path.join(realRoot,'a.txt'),'still readable');constfd=fs.openSync(path.join(mountPoint,'a.txt'),'r');fs.renameSync(path.join(realRoot,'a.txt'),path.join(realRoot,'b.txt'));try{console.log(fs.readFileSync(fd,'utf8'));}finally{fs.closeSync(fd);}}finally{mounted.unmount();fs.rmSync(realRoot,{recursive: true,force: true});fs.rmSync(mountPoint,{recursive: true,force: true});}How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
It should print still readable. An already-open fd should remain usable after the file is renamed, matching native filesystem behavior.
What do you see instead?
fs.readFileSync(fd, 'utf8') throws ENOENT after the backing file is renamed. This shows RealFSProvider is trying to read through the original path.
Additional information
No response
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?
It should print
still readable. An already-openfdshould remain usable after the file is renamed, matching native filesystem behavior.What do you see instead?
fs.readFileSync(fd, 'utf8')throwsENOENTafter the backing file is renamed. This shows RealFSProvider is trying to read through the original path.Additional information
No response