Created
January 20, 2013 09:18
-
-
Save nickleefly/4577430 to your computer and use it in GitHub Desktop.
read from input, write to output
create dir then remove it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var file = fs.createReadStream('./input.txt', {flags: 'r'} ); | |
var out = fs.createWriteStream('./output.txt', {flags: 'w'}); | |
file.pipe(out); | |
var fs = require('fs'); | |
fs.mkdir('./newdir', 0666, function(err) { | |
if(err) throw err; | |
console.log('Created newdir'); | |
fs.rmdir('./newdir', function(err) { | |
if(err) throw err; | |
console.log('Removed newdir'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment