-
Notifications
You must be signed in to change notification settings - Fork 653
windows: ensure fs_event always provides filename #1436
base: master
Are you sure you want to change the base?
Conversation
`uv_fs_event` didn't provide filename argument on Windows when a file is deleted or renamed, although it does on Linux. Fix this by ensuring that fs_event always provides filename argument on Windows.
@nitoyon is this related to any issue open in Node? I remember something similar to this being discussed there. |
@saghul this PR fixes nodejs/node-v0.x-archive#8372 and #1479. |
@nitoyon thanks for the heads up. Could you please add a test, or modify an existing one, which validates the fix? |
It's not that I necessarily disagree. |
Thanks for chiming in @piscisaureus :-) On top of that, we also need to be consistent with what we do in other platforms (which I don't remember from the top of my head). |
@saghul It looks hard to add a test because there is no test which assert that And the document for fs.watch() in Node.js says:
It would break unit test if we add a test which asserts @piscisaureus We have already provided short filenames if |
fs.watch is different to most Node functionality in that it does not promise to be the same cross-platform. But this promise is still very helpful. It makes it much easier to watch for filesystem events without resorting to any native dependencies. And for anyone using fs.watch, they immediately need to start out by considering cross-platform differences anyway. They are probably going to already be aware of things like 8.3 short names and unicode and casing differences. So it would be helpful to me if fs.watch gave as much information as possible according to each platform. In this specific case, even the 8.3 short name would be very useful. And if the callback could always provide the 8.3 short name as extra info on Windows for the other events that would be even better. |
uv_fs_event
didn't provide filename argument on Windows when a file is deleted or renamed, although it does on Linux.Fix this by ensuring that fs_event always provides filename argument on Windows.
Node.js API document says:
But, it's better that we provide
filename
argument if we can, isn't it?How to reproduce this bug
Use following script:
Linux
On CentOS 6.4 x64 (Node.js v0.10.29)
On Windows 8.1 x64 (Node.j v0.10.21)