denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
98.04k stars 5.39k forks source link

`Deno.watchFs` does not catch 'remove' event since v2.0.3 #26906

Open kt3k opened 6 days ago

kt3k commented 6 days ago

The below script catches 'remove' events until Deno 2.0.2:

const watcher = Deno.watchFs('.'); 
for await (const e of watcher) {
  console.log(">>> event", e); 
}
touch test.txt # => causes "create" event
rm test.txt # => causes "remove" event

However, it doesn't catch "remove" event anymore since Deno 2.0.3.

Version: Deno 2.0.3

littledivy commented 6 days ago

@kt3k Is this on macOS or Linux?

kt3k commented 6 days ago

I checked that on macos

saurabhdiwanji commented 6 days ago

I checked it on windows. it did not work in Windows as well. I too created the issue and issue is linked here https://github.com/denoland/std/issues/6192

saurabhdiwanji commented 6 days ago

it is the move and remove event is not triggered. and when we use move command to rename it works as expected.

kt3k commented 2 days ago

It looks like the first version this started happening is be969cb5328bb83c26022ea5307467b40647cb64 (#26200) (It didn't happen with 285635daa67274f961d29c1e7795222709dc9618 ) (Checked with arm macOS)