You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several `node:fs` entry points behave differently for a mounted path
than for a real one, because of how the call reaches the VFS hooks.
Make them behave as they do for a real path:
* Add the `watchFile`, `unwatchFile` and `promisesWatch` handlers,
backed by the provider's stat watcher and async watcher; those calls
threw a TypeError before. Have `watch` refuse a path that does not
exist with ENOENT instead of handing back a watcher that polls
forever and keeps the process alive.
* Convert timestamps and validate arguments before the hook runs in
`utimes`, `lutimes` and `readdir` (sync, callback and promise forms),
so a mounted path gets the same ERR_INVALID_ARG_* errors and the same
seconds-since-epoch numbers as a real one.
* Pass the mode and times through to the `fchmod` and `futimes` hooks
and route them to the handle's entry, so descriptor operations take
effect like their path forms instead of being no-ops; the memory
handle validates the way a FileHandle would since one calls it
directly.
* Treat a `mkdtemp` prefix as text rather than a path when it ends in a
separator, so the directory is created inside the intended parent.
* Map the first directory a recursive `mkdir` created back under the
mount point instead of returning the provider-relative path.
* Make disposing an already closed virtual `Dir` a no-op, as on the
native `Dir`, instead of rejecting with ERR_DIR_CLOSED.
test-vfs-fs-hook-gaps adds a test per gap, stating the real-fs outcome
as the expectation. The existing file handle test asserted that
`chmod()` and `utimes()` without arguments were no-ops; they now
validate and apply, so it exercises that instead.
Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
PR-URL: #65852
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
0 commit comments