Skip to content

Instantly share code, notes, and snippets.

@caged
Created September 25, 2010 22:41
Show Gist options
  • Select an option

  • Save caged/597373 to your computer and use it in GitHub Desktop.

Select an option

Save caged/597373 to your computer and use it in GitHub Desktop.
pipe(): Too many open files
child_process:191
var fds = this.fds = this._internal.spawn(path, args, cwd, envPairs, customF
^
Error: Error spawning
at ChildProcess.spawn (child_process:191:39)
at child_process:9:15
at Object.execFile (child_process:59:15)
at child_process:15:20
at /Users/justin/dev/lrr/node/pdxcrime/lib/test.js:7:3
at /usr/local/Cellar/npm/0.2.2/lib/node/.npm/ecsv/0.3.2-1-LINK-1d3612b9/package/lib/ecsv.js:76:34
at Array.forEach (native)
at [object Object].<anonymous> (/usr/local/Cellar/npm/0.2.2/lib/node/.npm/ecsv/0.3.2-1-LINK-1d3612b9/package/lib/ecsv.js:54:13)
at [object Object].emit (events:27:15)
at [object Object]._emitData (fs:733:29)
var sys = require('sys'),
exec = require('child_process').exec,
fs = require('fs'),
ecsv = require('ecsv')
ecsv.each('../pub/data/crime_incident_data.csv', function(crime) {
exec('wc -c "foo"', function(err, stdout, stderr) {
console.log('woot');
})
})
@dominictarr

Copy link
Copy Markdown

even this produces this error for me:
var sys = require('sys'),
exec = require('child_process').exec,
// fs = require('fs');
// ecsv = require('ecsv')

//ecsv.each('../pub/data/crime_incident_data.csv', function(crime) {
for (i = 0 ; i < 350; i ++) {
  exec('wc -c "foo"', function(err, stdout, stderr) {
    console.log('woot'); 
  });
} 

//})

the short answer is do you really need to open so many files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment