-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add proposal for the FileSystemObserver interface #124
Conversation
Thanks for this proposal! I'm not a code owner so I might not be the right person for this. But these are some thoughts I had after reading the proposal.
|
Thanks for taking a look at the proposal! I expect it will address your use case :)
Could you file a separate issue for this with a repro case? I did some basic tests and wasn't able to get We should probably add web platform tests, especially if there is a discrepancy https://github.com/web-platform-tests/wpt/tree/master/fs
The user agent will handle watching subdirectories. However, it is significantly more resource-intensive (i.e. consumes memory, and more importantly file descriptors) to recursively watch a directory using inotify, since a watch descriptor needs to be created for every subdirectory. This is an implementation detail that web authors ideally wouldn't need to worry about, but given the exponential difference in system resource use and that user agents will add restrictions on the number of (sub)directories that can be watched (and behavioral differences, such as that changes to a newly-mounted sub-directory could be missed while the watch descriptors are being created) it's unfortunately a detail that's hard to hide... For example, on Linux it's much more likely that
Unfortunately, it's hard for the user agent to know much about why a watch has failed, either. Your best bet is to attempt to restart the observation by calling |
As a reminder, changes like this shouldn't be committed without a |
Ah no this was just a hypothetical situation in which a user agent might reuse existing references in
Thanks for the clarification, that makes sense. |
Proposal for a new interface which allows a website to be notified of changes to files and directories.
See #123 and WICG/file-system-access#72