diff options
author | Rafael Gonzaga <rafael.nunu@hotmail.com> | 2023-02-23 15:11:51 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-23 18:11:51 +0000 |
commit | 00c222593e49d817281bc88a322f41f8dca95885 (patch) | |
tree | 29e6fd71f93dd98d8bb3fcd535d49ed80bdeacd5 /lib/fs.js | |
parent | 42be7f6a0335c396810be91c3f3724007029f83d (diff) | |
download | node-new-00c222593e49d817281bc88a322f41f8dca95885.tar.gz |
src,process: add permission model
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/44004
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib/fs.js')
-rw-r--r-- | lib/fs.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -104,6 +104,7 @@ const { getValidMode, handleErrorFromBinding, nullCheck, + possiblyTransformPath, preprocessSymlinkDestination, Stats, getStatFsFromBinding, @@ -2338,16 +2339,17 @@ function watch(filename, options, listener) { let watcher; const watchers = require('internal/fs/watchers'); + const path = possiblyTransformPath(filename); // TODO(anonrig): Remove non-native watcher when/if libuv supports recursive. // As of November 2022, libuv does not support recursive file watch on all platforms, // e.g. Linux due to the limitations of inotify. if (options.recursive && !isOSX && !isWindows) { const nonNativeWatcher = require('internal/fs/recursive_watch'); watcher = new nonNativeWatcher.FSWatcher(options); - watcher[watchers.kFSWatchStart](filename); + watcher[watchers.kFSWatchStart](path); } else { watcher = new watchers.FSWatcher(); - watcher[watchers.kFSWatchStart](filename, + watcher[watchers.kFSWatchStart](path, options.persistent, options.recursive, options.encoding); |