Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Fix symlink create notifications on Linux #42

Merged
merged 1 commit into from
May 10, 2013
Merged

Conversation

tsg
Copy link
Contributor

@tsg tsg commented May 9, 2013

The linux code used to ignore events on the files that os.Stat reports as
non existing. This ignores the CREATEion of broken links, but monitoring
those can be useful, for example /proc//fd/ contains fake links
for all sockets.

The patch simply replaces os.Stat with os.Lstat to solve the issue.

I updated the fsnotify_symlink_test.go to what I consider the correct
behavior but unfortunately couldn't test under windows, so I'm not sure
if it breaks the test there or not.

The linux code used to ignore events on the files that os.Stat reports as
non existing. This ignores the CREATEion of broken links, but monitoring
those can be useful, for example /proc/<pid>/fd/ contains fake links
for all sockets.

The patch simply replaces os.Stat with os.Lstat to solve the issue.

I updated the fsnotify_symlink_test.go to what I consider the correct
behavior but unfortunately couldn't test under windows, so I'm not sure
if it breaks the test there or not.
@howeyc howeyc merged commit 671de62 into howeyc:master May 10, 2013
@howeyc
Copy link
Owner

howeyc commented May 10, 2013

Looks good to me. Test works on BSD too.

The test is skipped on Windows, so we're good there too.

Thanks.

rsc pushed a commit to golang/exp that referenced this pull request Dec 7, 2014
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
GoogleCodeExporter pushed a commit to bsed/go-zh.exp that referenced this pull request May 31, 2015
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 <rsc@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants