vfs: support writeFileSync with virtual fds · nodejs/node@322230d · GitHub
Skip to content

Commit 322230d

Browse files
trivikrrichardlau
authored andcommitted
vfs: support writeFileSync with virtual fds
Route fs.writeFileSync() and fs.appendFileSync() calls with VFS-owned file descriptors through the virtual file handle instead of falling back to the native fs binding. This preserves descriptor semantics for both memory-backed VFS files and RealFSProvider handles. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #64165 Fixes: #64164 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent aeb539a commit 322230d

2 files changed

Lines changed: 93 additions & 4 deletions

File tree

lib/internal/vfs/setup.js

Lines changed: 34 additions & 4 deletions

test/parallel/test-vfs-fs-writeFileSync.js

Lines changed: 59 additions & 0 deletions

0 commit comments

Comments
 (0)