gaze icon indicating copy to clipboard operation
gaze copied to clipboard

Incomplete and/or erronous implementation of "renamed" event

Open fnk opened this issue 10 years ago • 5 comments

When i rename a watched file "a.txt" to "b.txt" i receive following events in this order:

deleted(a.txt) renamed(undefined, b.txt)

Also, in README.md, the "Usage" passage does not handle "renamed" and the "Events" passage shows an invalid method signature for "renamed"

cheers, andi.

Update: My environment is: Win 7, Node 0.8.3, npm 1.1.43, gaze 0.4.2

fnk avatar Oct 17 '13 12:10 fnk

Node 0.8.3 is very old. Could you update to the latest v0.8 release or even better, upgrade to the latest node v0.10 and try again? Thanks!

shama avatar Oct 17 '13 15:10 shama

I will get back to you on this next week. Currently i have no access to the environment and do not know if we can upgrade there to a newer version.

Thanks, Andi.

fnk avatar Oct 18 '13 12:10 fnk

Hi guys ! I ran into a similar issue with node 0.10.18 and 0.10.21 on Ubuntu 12.04. Renaming a file results in a deleted event and it's not watched anymore after that. (in my case there's no renamed event)

nojhamster avatar Oct 21 '13 06:10 nojhamster

can confirm in 0.10.25. If the file is within the watch pattern e.g. **/*.log and you mv asdf.log qwer.log you will receive a deleted event followed by a rename. I think that the deleted event is in error.

On the other hand, if you have a very restrictive pattern say asdf.log and again you mv asdf.log qwer.log you will only receive a deleted event.

I think that in both cases, only the rename should be raised. Though making the second case work may be hard...

seebees avatar Mar 13 '14 17:03 seebees

Hi,

It doesn't seem to be an issue related to node.js version. I have the same behavior on v6.5.0. Getting deleted followed by rename which makes me to workaround the situation and delay deletes if they weren't really deletes to be able to cancel them in rename event. My pattern is very loose, matching both names before and after rename.

ipatalas avatar Dec 11 '16 14:12 ipatalas