Last active
August 29, 2015 14:21
-
-
Save gouthamve/179e3222640914c08ecf to your computer and use it in GitHub Desktop.
Script to create 100 folders with files inside them
This file contains 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 create = function(i) { | |
fs.mkdir('folder'+i, 0700, function(err) { | |
if(err) | |
console.log(err) | |
fs.open('folder'+i+'/file'+i, 'w', 0700, function(err, fd) { | |
fs.close(fd); | |
}) | |
}) | |
}; | |
for(var i = 1; i <= 100; i++) { | |
create(i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment