Skip to content

Instantly share code, notes, and snippets.

@gouthamve
Last active August 29, 2015 14:21
Show Gist options
  • Save gouthamve/179e3222640914c08ecf to your computer and use it in GitHub Desktop.
Save gouthamve/179e3222640914c08ecf to your computer and use it in GitHub Desktop.
Script to create 100 folders with files inside them
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