{"action":"created","issue":{"url":"https://api.github.com/repos/Noitidart/jscFileWatcher/issues/3","labels_url":"https://api.github.com/repos/Noitidart/jscFileWatcher/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Noitidart/jscFileWatcher/issues/3/comments","events_url":"https://api.github.com/repos/Noitidart/jscFileWatcher/issues/3/events","html_url":"https://github.com/Noitidart/jscFileWatcher/issues/3","id":68465005,"number":3,"title":"kqueue doesnt watch contents of dir","user":{"login":"Noitidart","id":6372489,"avatar_url":"https://avatars.githubusercontent.com/u/6372489?v=3","gravatar_id":"","url":"https://api.github.com/users/Noitidart","html_url":"https://github.com/Noitidart","followers_url":"https://api.github.com/users/Noitidart/followers","following_url":"https://api.github.com/users/Noitidart/following{/other_user}","gists_url":"https://api.github.com/users/Noitidart/gists{/gist_id}","starred_url":"https://api.github.com/users/Noitidart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noitidart/subscriptions","organizations_url":"https://api.github.com/users/Noitidart/orgs","repos_url":"https://api.github.com/users/Noitidart/repos","events_url":"https://api.github.com/users/Noitidart/events{/privacy}","received_events_url":"https://api.github.com/users/Noitidart/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Noitidart/jscFileWatcher/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"Noitidart","id":6372489,"avatar_url":"https://avatars.githubusercontent.com/u/6372489?v=3","gravatar_id":"","url":"https://api.github.com/users/Noitidart","html_url":"https://github.com/Noitidart","followers_url":"https://api.github.com/users/Noitidart/followers","following_url":"https://api.github.com/users/Noitidart/following{/other_user}","gists_url":"https://api.github.com/users/Noitidart/gists{/gist_id}","starred_url":"https://api.github.com/users/Noitidart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noitidart/subscriptions","organizations_url":"https://api.github.com/users/Noitidart/orgs","repos_url":"https://api.github.com/users/Noitidart/repos","events_url":"https://api.github.com/users/Noitidart/events{/privacy}","received_events_url":"https://api.github.com/users/Noitidart/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-04-14T18:40:07Z","updated_at":"2015-04-16T21:39:13Z","closed_at":null,"body":"so kqueue doesnt watch contents of dir. so what i have to do is this:\r\n\r\nin mainthread api in addWatch, before add'ing to events_to_monitor array via ctypes. do a OS.File.Directoryiterator to get all contents of that folder and save it to that path in thisW.paths_watched__dir_cont[aOSPath] = [arrray_containing_names_of_all_files]\r\n\r\nthen after kqueue triggers notification, get the path to the maintrhead api, before calling callback, it does another OS.File.DirectorYiterator to the contents of that folder again then compares it to the previously held one. If multiple changes found, then trigger multiple callbacks, so this takes some time so additional notifications could have triggered from the poll. so when start poll back up you might get instances where it triggers notification but i already caught the changes by doing the DirectoryIterator compare."},"comment":{"url":"https://api.github.com/repos/Noitidart/jscFileWatcher/issues/comments/93845781","html_url":"https://github.com/Noitidart/jscFileWatcher/issues/3#issuecomment-93845781","issue_url":"https://api.github.com/repos/Noitidart/jscFileWatcher/issues/3","id":93845781,"user":{"login":"Noitidart","id":6372489,"avatar_url":"https://avatars.githubusercontent.com/u/6372489?v=3","gravatar_id":"","url":"https://api.github.com/users/Noitidart","html_url":"https://github.com/Noitidart","followers_url":"https://api.github.com/users/Noitidart/followers","following_url":"https://api.github.com/users/Noitidart/following{/other_user}","gists_url":"https://api.github.com/users/Noitidart/gists{/gist_id}","starred_url":"https://api.github.com/users/Noitidart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noitidart/subscriptions","organizations_url":"https://api.github.com/users/Noitidart/orgs","repos_url":"https://api.github.com/users/Noitidart/repos","events_url":"https://api.github.com/users/Noitidart/events{/privacy}","received_events_url":"https://api.github.com/users/Noitidart/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T21:39:13Z","updated_at":"2015-04-16T21:39:13Z","body":"Solution to my previous comment/concern:\r\n\r\n> This logic MAY have issue in that it might not notify when a file within the directory is `contents-modified` im not sure, i have to test to see if it triggers notify when a child file is modded.\r\n\r\nI tested on OSX and when you modify a file inside a directory it does trigger on that directory, so when i stat the directory for its contents, save file names and last modified times. comparing the last modified time will enable us to identify if the contents-modified of a file."}}