Skip to content

Commit

Permalink
Ejercicio Opcional tema3. stream
Browse files Browse the repository at this point in the history
  • Loading branch information
salvacam committed May 21, 2015
1 parent b27b1ac commit d412795
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tema3/merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ if (process.argv.length < 4) {
console.log("syntax: 'node merge dest f1 f2 ..fn'");
process.exit()
}
var readStream;
var writeStream = fs.createWriteStream(process.argv[2]);;

for (var i = 3; i < process.argv.length; i ++) {
//console.log(i +" - "+ process.argv[i]);
readStream = fs.createReadStream(process.argv[i]);
readStream.pipe(writeStream);
/*
fs.readFile (
process.argv[i],
function(err, data) {
Expand All @@ -19,4 +23,5 @@ for (var i = 3; i < process.argv.length; i ++) {
);
}
);
}
*/
}

0 comments on commit d412795

Please sign in to comment.