This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
fs.watch on Windows 7: Renaming a file does not emit event for original path #8372
Labels
Comments
It may be that libuv drops FILE_ACTION_RENAMED_OLD_NAME events. Do you get a 'rename' event with a null filename? |
Thanks Ben. Yes, when renaming "a.txt" to "b.txt" I get the following events from fs.watch on Windows: rename null Subsequently deleting "b.txt" just gives: rename null |
Thanks, that would be great. |
@jorangreef Can you open an issue on libuv about this and link back here? Extra karma if you can work on a patch ;-) |
Thanks @saghul joyent/libuv#1479 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
On Mac, using fs.watch on a directory, and then renaming a file in that directory, will emit two events, one for the file which was "deleted" and one for the file which was "created". Combining these two events later by comparing content can be used to detect renames.
But on Windows, no event is emitted for the original path. Is there no way to modify the usage of ReadDirectoryChangesW to get an event when the original path is removed or renamed to something else?
The text was updated successfully, but these errors were encountered: