{"issue":{"title":"pipe(): Too many open files","user":{"login":"braddunbar","id":11674,"url":"https://api.github.com/users/braddunbar","avatar_url":"https://secure.gravatar.com/avatar/0168f51cd822a820c606c259b80e253f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"0168f51cd822a820c606c259b80e253f"},"created_at":"2011-07-22T19:52:37Z","milestone":null,"labels":[],"state":"open","updated_at":"2011-12-27T18:29:54Z","id":1272145,"closed_at":null,"html_url":"https://github.com/jashkenas/coffee-script/issues/1537","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"When running `coffee` on a directory with a  large number of files (329 to be exact), I receive the following error:\r\n\r\n    pipe(): Too many open files\r\n    \r\n    child_process.js:243\r\n      var fds = this._internal.spawn(path,\r\n                           ^\r\n    Error: Error spawning\r\n        at ChildProcess.spawn (child_process.js:243:28)\r\n        at child_process.js:31:15\r\n        at child_process.js:77:15\r\n        at child_process.js:38:27\r\n        at /Users/brad/dev/coffee-script/lib/command.js:242:16\r\n        at path.js:292:19\r\n\r\nThe failure seems to center on the call to [`mkdir -p`](https://github.com/jashkenas/coffee-script/blob/860c5030d263fc6e2af651da6ab1043ceeb450e3/src/command.coffee#L191).  I've yet to find a way to fix this cleanly.","number":1537,"url":"https://api.github.com/repos/jashkenas/coffee-script/issues/1537","comments":2,"assignee":null},"comment":{"user":{"login":"viatropos","id":28718,"url":"https://api.github.com/users/viatropos","avatar_url":"https://secure.gravatar.com/avatar/a2beb162438985ede0a49b240aa17ca1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"a2beb162438985ede0a49b240aa17ca1"},"created_at":"2011-12-27T18:29:54Z","updated_at":"2011-12-27T18:29:54Z","id":3283914,"body":"I'm getting a similar error because of too many files open:\r\n\r\n```\r\nfs.js:632\r\n    throw errnoException(errno, 'watch');\r\n10:22:36 - compiled src/tower/support.coffee\r\n^\r\nError: watch EMFILE\r\n    at errnoException (fs.js:605:11)\r\n    at FSWatcher.start (fs.js:632:11)\r\n    at Object.watch (fs.js:660:11)\r\n    at Object.oncomplete (/Users/viatropos/Documents/git/personal/plugins/tower.js/node_modules/coffee-script/lib/coffee-script/command.js:201:17)\r\n```\r\n\r\nThis should just be written with something like the [async.js](https://github.com/caolan/async) library:\r\n\r\n[https://github.com/jashkenas/coffee-script/blob/master/src/command.coffee#L106](https://github.com/jashkenas/coffee-script/blob/4a0e8139eaef343473024989ad9b11463e9a0fe1/src/command.coffee#L106)","url":"https://api.github.com/repos/jashkenas/coffee-script/issues/comments/3283914"},"action":"created"}