{"action":"created","issue":{"url":"https://api.github.com/repos/passcod/rsnotify/issues/21","labels_url":"https://api.github.com/repos/passcod/rsnotify/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/passcod/rsnotify/issues/21/comments","events_url":"https://api.github.com/repos/passcod/rsnotify/issues/21/events","html_url":"https://github.com/passcod/rsnotify/issues/21","id":93281636,"number":21,"title":"Getting error when working with emacs lockfile, Linux","user":{"login":"sunng87","id":221942,"avatar_url":"https://avatars.githubusercontent.com/u/221942?v=3","gravatar_id":"","url":"https://api.github.com/users/sunng87","html_url":"https://github.com/sunng87","followers_url":"https://api.github.com/users/sunng87/followers","following_url":"https://api.github.com/users/sunng87/following{/other_user}","gists_url":"https://api.github.com/users/sunng87/gists{/gist_id}","starred_url":"https://api.github.com/users/sunng87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunng87/subscriptions","organizations_url":"https://api.github.com/users/sunng87/orgs","repos_url":"https://api.github.com/users/sunng87/repos","events_url":"https://api.github.com/users/sunng87/events{/privacy}","received_events_url":"https://api.github.com/users/sunng87/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/passcod/rsnotify/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/passcod/rsnotify/labels/os-linux","name":"os-linux","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-06T13:43:05Z","updated_at":"2015-12-05T11:23:21Z","closed_at":null,"body":"I'm on Linux kernel 4.1.0, rsnotify 2.1.0 and Emacs 24.5.\r\n\r\nMy code is as simple as:\r\n\r\n```rust\r\nfn _watch (p: &Path) -> Result<(), Error>{\r\n    let (tx, rx) = channel();\r\n    let mut watcher: RecommendedWatcher = try!(Watcher::new(tx));\r\n    println!(\"watcher init\");\r\n    try!(watcher.watch(p));\r\n    println!(\"watching\");\r\n    let _ = rx.recv();\r\n    Ok(())\r\n}\r\n```\r\n\r\nEvery time I modified files in Emacs, `watcher.watch(p)` returns error:\r\n\r\n```\r\nIo(Error { repr: Os { code: 2, message: \"No such file or directory\" } })\r\n```\r\n\r\nIf I `ls -al` the watched directory, I'm getting:\r\n\r\n```\r\n $ ls -al examples/templates  \r\ndrwxr-xr-x 2 nsun nsun 4096 Jul  6 21:04 .\r\ndrwxr-xr-x 3 nsun nsun 4096 Jul  4 10:37 ..\r\nlrwxrwxrwx 1 nsun nsun   31 Jul  6 21:04 .#index.hbs -> nsun@thinkless.17462:1435199339\r\n-rw-r--r-- 1 nsun nsun  279 Jul  6 20:57 index.hbs\r\n```\r\n\r\nThe `.#index.hbs` symbol link, as [the SO question](http://stackoverflow.com/questions/5738170/why-does-emacs-create-temporary-symbolic-links-for-modified-files) said, is Emacs lockfile. \r\n\r\nI'm not quite sure if this is an rsnotify issue, anything suggestion or workaround are welcomed."},"comment":{"url":"https://api.github.com/repos/passcod/rsnotify/issues/comments/162174316","html_url":"https://github.com/passcod/rsnotify/issues/21#issuecomment-162174316","issue_url":"https://api.github.com/repos/passcod/rsnotify/issues/21","id":162174316,"user":{"login":"passcod","id":155787,"avatar_url":"https://avatars.githubusercontent.com/u/155787?v=3","gravatar_id":"","url":"https://api.github.com/users/passcod","html_url":"https://github.com/passcod","followers_url":"https://api.github.com/users/passcod/followers","following_url":"https://api.github.com/users/passcod/following{/other_user}","gists_url":"https://api.github.com/users/passcod/gists{/gist_id}","starred_url":"https://api.github.com/users/passcod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/passcod/subscriptions","organizations_url":"https://api.github.com/users/passcod/orgs","repos_url":"https://api.github.com/users/passcod/repos","events_url":"https://api.github.com/users/passcod/events{/privacy}","received_events_url":"https://api.github.com/users/passcod/received_events","type":"User","site_admin":false},"created_at":"2015-12-05T11:23:21Z","updated_at":"2015-12-05T11:23:21Z","body":"It should probably check that the path it's given is a directory or a regular file, and if it's a symlink it should attempt to dereference it, and only feed it to the watcher if either of those is the case. I imagine rsnotify also fails if invoked on, say, \"special\" files in `/dev`, `/sys`, or `/proc`."}}