filerjs / filer

Node-like file system for browsers
BSD 2-Clause "Simplified" License
611 stars 151 forks source link

Support watch events for hard links #594

Open humphd opened 5 years ago

humphd commented 5 years ago

In our implementation of watch events, we assume path names are enough to trigger events: a file is changed, we use the path to look at registered watchers (for that path or path prefix), and fire off events. This breaks for hard links created with fs.link().

We probably need to do more work when we register the watch. Maybe we stat the path and get the file node's id (in the case of a file). Or maybe we can borrow something from chokidar. What we do for file paths will also need to be thought through for dirs.

This is a bit of an edge case, and I'm not sure how much work to do to support it. But I'm going to land a test and skip() it, so we can return to this later.

humphd commented 5 years ago

Test landed in https://github.com/filerjs/filer/pull/595