denoland / deno_std

The Deno Standard Library
https://jsr.io/@std
MIT License
2.83k stars 581 forks source link

bug: `fs.walk()` throws not found error #5164

Closed jeiea closed 5 days ago

jeiea commented 5 days ago

Describe the bug

NotFound: No such file or directory (os error 2): stat '/Users/jeiea/Documents/project/project.inlang/messagelock'
    at async Object.stat (ext:deno_fs/30_fs.js:420:15)
    at async createWalkEntry (https://jsr.io/@std/fs/0.229.3/_create_walk_entry.ts:37:16)
    at async walk (https://jsr.io/@std/fs/0.229.3/walk.ts:536:11)
    at async advanceMatch (https://jsr.io/@std/fs/0.229.3/expand_glob.ts:337:13)
    at async https://jsr.io/@std/fs/0.229.3/expand_glob.ts:359:26
    at async Promise.all (index 42577)
    at async expandGlob (https://jsr.io/@std/fs/0.229.3/expand_glob.ts:357:5)
    at async https://jsr.io/@std/async@0.224.2/pooled_map.ts:67:24 {name: 'NotFound', code: 'ENOENT', stack: 'NotFound: No such file or directory (os error…sync@0.224.2/pooled_map.ts:67:24', message: "No such file or directory (os error 2): stat…/project.inlang/messagelock'"}

Steps to Reproduce

  1. expandGlob("...many entries pattern")
  2. create and delete files that matching pattern (maybe?)

Expected behavior

It should ignore not found entries.

Environment

iuioiua commented 5 days ago

Can you please provide a minimal reproducible example, including a code snippet, file structure, and clear steps?

jeiea commented 5 days ago

When I have more time, I can try opening a PR with a test case.

jeiea commented 5 days ago

I have to contrive the test case (because it's from complex codebase), so feel free to make changes without my additional infos, I don't know I can contibute.

iuioiua commented 5 days ago

Ok, I'll close this issue for now. Please feel free to re-open it once you've gathered all the relevant information 🙂