MCPcopy Create free account
hub / github.com/nodejs/node / [kFSWatchStart]

Method [kFSWatchStart]

lib/internal/fs/recursive_watch.js:222–243  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

220 }
221
222 [kFSWatchStart](filename) {
223 filename = pathResolve(getValidatedPath(filename));
224
225 try {
226 const file = lazyLoadFsSync().statSync(filename);
227
228 this.#rootPath = filename;
229 this.#closed = false;
230 this.#watchingFile = file.isFile();
231
232 this.#watchFile(filename);
233 if (file.isDirectory()) {
234 this.#watchFolder(filename);
235 }
236 } catch (error) {
237 if (!this.#options.throwIfNoEntry && error.code === 'ENOENT') {
238 error.filename = filename;
239 throw error;
240 }
241 }
242
243 }
244
245 ref() {
246 this.#files.forEach((file) => {

Callers

nothing calls this directly

Calls 6

#watchFileMethod · 0.95
#watchFolderMethod · 0.95
lazyLoadFsSyncFunction · 0.85
statSyncMethod · 0.45
isFileMethod · 0.45
isDirectoryMethod · 0.45

Tested by

no test coverage detected