{"action":"created","issue":{"url":"https://api.github.com/repos/libuv/libuv/issues/682","repository_url":"https://api.github.com/repos/libuv/libuv","labels_url":"https://api.github.com/repos/libuv/libuv/issues/682/labels{/name}","comments_url":"https://api.github.com/repos/libuv/libuv/issues/682/comments","events_url":"https://api.github.com/repos/libuv/libuv/issues/682/events","html_url":"https://github.com/libuv/libuv/pull/682","id":126305070,"number":682,"title":"Grab file name from file_info for accuracy","user":{"login":"jsheely","id":1424946,"avatar_url":"https://avatars.githubusercontent.com/u/1424946?v=3","gravatar_id":"","url":"https://api.github.com/users/jsheely","html_url":"https://github.com/jsheely","followers_url":"https://api.github.com/users/jsheely/followers","following_url":"https://api.github.com/users/jsheely/following{/other_user}","gists_url":"https://api.github.com/users/jsheely/gists{/gist_id}","starred_url":"https://api.github.com/users/jsheely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsheely/subscriptions","organizations_url":"https://api.github.com/users/jsheely/orgs","repos_url":"https://api.github.com/users/jsheely/repos","events_url":"https://api.github.com/users/jsheely/events{/privacy}","received_events_url":"https://api.github.com/users/jsheely/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/libuv/libuv/labels/windows","name":"windows","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-01-12T23:43:10Z","updated_at":"2016-05-05T10:56:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/libuv/libuv/pulls/682","html_url":"https://github.com/libuv/libuv/pull/682","diff_url":"https://github.com/libuv/libuv/pull/682.diff","patch_url":"https://github.com/libuv/libuv/pull/682.patch"},"body":"The handle->filew out of ReadDirectoryChangesW grabs the closest match to the file but does not contain the actual file name\r\n\r\nfs.watch('**/*.jsx');\r\nex. /path/to/file/filename.jsx will match /path/to/file/filename.js if you use handle->filew\r\n\r\nUsing file_info->FileName it will return an event for filename.jsx or one for filename.js but at least in this case you will be able to properly filter the value in node since you have the correct file name to match against.\r\n\r\nThere is probably more we can do in order to ensure that the event doesn't leave libuv if it doesn't match the watched file path but at least this way we can accurately do something about it."},"comment":{"url":"https://api.github.com/repos/libuv/libuv/issues/comments/217124734","html_url":"https://github.com/libuv/libuv/pull/682#issuecomment-217124734","issue_url":"https://api.github.com/repos/libuv/libuv/issues/682","id":217124734,"user":{"login":"wc-matteo","id":10562635,"avatar_url":"https://avatars.githubusercontent.com/u/10562635?v=3","gravatar_id":"","url":"https://api.github.com/users/wc-matteo","html_url":"https://github.com/wc-matteo","followers_url":"https://api.github.com/users/wc-matteo/followers","following_url":"https://api.github.com/users/wc-matteo/following{/other_user}","gists_url":"https://api.github.com/users/wc-matteo/gists{/gist_id}","starred_url":"https://api.github.com/users/wc-matteo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wc-matteo/subscriptions","organizations_url":"https://api.github.com/users/wc-matteo/orgs","repos_url":"https://api.github.com/users/wc-matteo/repos","events_url":"https://api.github.com/users/wc-matteo/events{/privacy}","received_events_url":"https://api.github.com/users/wc-matteo/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T10:56:50Z","updated_at":"2016-05-05T10:56:50Z","body":"@jorangreef but that's not what the issue is about! The issue is about fixing _libuv_ so that the right file name is returned as changed to the upper layers; currently, on the Windows platform, there are many false-positive changes, as one can tell looking at bug reports for _chokidar_ and _nodejs_.\r\n\r\nNow, I don't know _libuv_ internals (yet!); there are some who says that _libuv_ has no concept of watched files and handles (i.e. watch) only directories; some disagree with this; others say it should be fixed in node; but then the node folks say it should be fixed in libuv...\r\n\r\nIs there no knowledgeable person around here that knows how _fsevents and_ Windows's _ReadDirectoryChangesW_ work in _libuv_ exactly?"}}