{"action":"created","issue":{"url":"https://api.github.com/repos/paulmillr/chokidar/issues/234","labels_url":"https://api.github.com/repos/paulmillr/chokidar/issues/234/labels{/name}","comments_url":"https://api.github.com/repos/paulmillr/chokidar/issues/234/comments","events_url":"https://api.github.com/repos/paulmillr/chokidar/issues/234/events","html_url":"https://github.com/paulmillr/chokidar/issues/234","id":57855136,"number":234,"title":"Windows: unlinkDir sometimes doesn't fire","user":{"login":"silverwind","id":115237,"avatar_url":"https://avatars.githubusercontent.com/u/115237?v=3","gravatar_id":"","url":"https://api.github.com/users/silverwind","html_url":"https://github.com/silverwind","followers_url":"https://api.github.com/users/silverwind/followers","following_url":"https://api.github.com/users/silverwind/following{/other_user}","gists_url":"https://api.github.com/users/silverwind/gists{/gist_id}","starred_url":"https://api.github.com/users/silverwind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverwind/subscriptions","organizations_url":"https://api.github.com/users/silverwind/orgs","repos_url":"https://api.github.com/users/silverwind/repos","events_url":"https://api.github.com/users/silverwind/events{/privacy}","received_events_url":"https://api.github.com/users/silverwind/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-16T21:49:18Z","updated_at":"2015-02-17T19:05:02Z","closed_at":null,"body":"I still have to explore if this is reproducible, but I just deleted a directory with a single child file using\r\n\r\n````js\r\nrimraf(directory, {maxBusyTries: 10});\r\n````\r\n\r\nand while I got the `unlink` event for the file, no `unlinkDir` was fired for the parent directory. It does seem to happen pretty rarely, I encountered it in maybe one of hundred deletions."},"comment":{"url":"https://api.github.com/repos/paulmillr/chokidar/issues/comments/74729136","html_url":"https://github.com/paulmillr/chokidar/issues/234#issuecomment-74729136","issue_url":"https://api.github.com/repos/paulmillr/chokidar/issues/234","id":74729136,"user":{"login":"silverwind","id":115237,"avatar_url":"https://avatars.githubusercontent.com/u/115237?v=3","gravatar_id":"","url":"https://api.github.com/users/silverwind","html_url":"https://github.com/silverwind","followers_url":"https://api.github.com/users/silverwind/followers","following_url":"https://api.github.com/users/silverwind/following{/other_user}","gists_url":"https://api.github.com/users/silverwind/gists{/gist_id}","starred_url":"https://api.github.com/users/silverwind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverwind/subscriptions","organizations_url":"https://api.github.com/users/silverwind/orgs","repos_url":"https://api.github.com/users/silverwind/repos","events_url":"https://api.github.com/users/silverwind/events{/privacy}","received_events_url":"https://api.github.com/users/silverwind/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T19:05:02Z","updated_at":"2015-02-17T19:05:02Z","body":"FYI: Playing a bit with the spacing, it seems at around 150ms is a point where I start to get all of the events.\r\n\r\n````js\r\nvar fs = require('fs');\r\nvar rimraf = require('rimraf');\r\nvar stats = {runs:0}, ready;\r\n\r\nvar SPACING = 150;\r\n\r\nfunction go() {\r\n  console.log(stats);\r\n  stats.runs++;\r\n  fs.mkdir('test', function () {\r\n    setTimeout(function() {\r\n        fs.writeFile('test/test.file', function () {\r\n            setTimeout(function () {\r\n                rimraf('test', function () {\r\n                    setTimeout(go, SPACING);\r\n                });\r\n            }, SPACING);\r\n        });\r\n    }, SPACING);\r\n  });\r\n}\r\n\r\nrequire('./').watch('.', {\r\n  persistent: true\r\n}).on('all', function(event) {\r\n  if (!ready) return;\r\n  if (!stats[event]) stats[event] = 0;\r\n  stats[event]++;\r\n}).on('ready', function () {\r\n  ready = true;\r\n  go();\r\n});\r\n````"}}