Lines Matching refs:file
53 for await (const file of filenames) {
54 const f = pathJoin(dir, file.name);
56 files.set(f, file);
59 if (file.isSymbolicLink()) {
61 } else if (file.isDirectory()) {
117 for (const file of this.#files.keys()) {
118 unwatchFile(file);
126 #unwatchFiles(file) {
129 this.#symbolicFiles.delete(file);
132 if (StringPrototypeStartsWith(filename, file)) {
144 for await (const file of files) {
149 const f = pathJoin(folder, file.name);
154 if (file.isSymbolicLink()) {
158 if (file.isFile()) {
161 this.#files.set(f, file);
163 if (file.isDirectory() && !file.isSymbolicLink()) {
174 #watchFile(file) {
180 const existingStat = this.#files.get(file);
182 watchFile(file, {
190 this.#files.set(file, currentStats);
193 // The file is now deleted
194 this.#files.delete(file);
195 this.emit('change', 'rename', pathRelative(this.#rootPath, file));
196 this.#unwatchFiles(file);
197 } else if (file === this.#rootPath && this.#watchingFile) {
198 // This case will only be triggered when watching a file with fs.watch
199 this.emit('change', 'change', pathBasename(file));
200 } else if (this.#symbolicFiles.has(file)) {
203 this.emit('change', 'rename', pathRelative(this.#rootPath, file));
205 this.#watchFolder(file);
214 const file = lazyLoadFsSync().statSync(filename);
218 this.#watchingFile = file.isFile();
220 if (file.isDirectory()) {
221 this.#files.set(filename, file);
244 this.#files.forEach((file) => {
245 if (file instanceof StatWatcher) {
246 file.ref();
252 this.#files.forEach((file) => {
253 if (file instanceof StatWatcher) {
254 file.unref();