-
Notifications
You must be signed in to change notification settings - Fork 252
BSD: Open files with O_EVTONLY flag #44
Comments
This is an interesting idea. I'll take a look. Thanks. |
Any chance you could test a change I made for this on OSX? I don't have an OSX machine. It's on the "evtonly" branch. |
Hi, As part of running the test, I changed example_test.go to import github.com/howeyc/fsnotify instead of code.google.com/p/go.exp/fsnotify (good job getting it into go.exp btw!). However, although I got it to pass twice, in generally "go test" fails on both master and evtonly. Here's a representative failure:
That being said, I tested edits, creates, and deletes manually and it seemed to work fine (in conjunction with Revel) |
Yeah, there's something not quite right with the tests. It's been like that since I made changes to them for go.exp. Thanks for testing the evtonly part. |
On a tangent -- should I update Revel to use go.exp/fsnotify? Are there any backwards incompatibilities to be worried about, or does it work strictly better? Thanks! |
I would advise against go.exp/fsnotify for now. I have not been very good at keeping it up to date. I am also not sure what kind of API changes will be made there, as the reason it's in exp is so the API is not considered stable and can be changed before being included in the standard library. |
WatchFlags of files created in Watched directories are now the same as the parent directory. (howeyc/fsnotify#33) Darwin now uses EVT_ONLY flag on Open file for watching. (howeyc/fsnotify#44) Linux has been updated to ignore events that occur after delete. (howeyc/fsnotify#36) Symlink test updated. (howeyc/fsnotify#42) Rename tests use external "mv" where available. R=golang-dev, dave, fullung, rsc CC=golang-dev https://golang.org/cl/9827046
WatchFlags of files created in Watched directories are now the same as the parent directory. (howeyc/fsnotify#33) Darwin now uses EVT_ONLY flag on Open file for watching. (howeyc/fsnotify#44) Linux has been updated to ignore events that occur after delete. (howeyc/fsnotify#36) Symlink test updated. (howeyc/fsnotify#42) Rename tests use external "mv" where available. R=golang-dev, dave, fullung, rsc CC=golang-dev https://codereview.appspot.com/9827046 Committer: Russ Cox <[email protected]>
Reading about the subject online, I came across a recommendation that files be opened with the O_EVTONLY flag instead of O_RDONLY, when watching is desired -- is that applicable here? I'm not sure if the system performs any optimizations with that, but the only functional benefit is that it will then not prevent an unmount of the volume that the file is on. (This is not directly applicable to my use case, just thought I'd notify you of my finding)
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/open.2.html
The text was updated successfully, but these errors were encountered: