11
rated 0 times
[
17]
[
6]
/ answers: 1 / hits: 170561
/ 9 Years ago, thu, september 10, 2015, 12:00:00
I am trying to loop through and pick up files in a directory, but I have some trouble implementing it. How to pull in multiple files and then move them to another folder?
var dirname = 'C:/FolderwithFiles';
console.log(Going to get file info!);
fs.stat(dirname, function (err, stats) {
if (err) {
return console.error(err);
}
console.log(stats);
console.log(Got file info successfully!);
// Check file type
console.log(isFile ? + stats.isFile());
console.log(isDirectory ? + stats.isDirectory());
});
More From » arrays