const readDir = (entry)=>{
const dirInfo = fs.readdirSync(entry);
dirInfo.forEach(item => {
const location = path.join(entry,item)
const info = fs.statSync(location)
if(info.isDirectory()){
console.log(`dir: ${location}`)
readDir(location)
}else{
console.log(`file: ${location}`)
}
})
}
readDir('/Users/ufutx/Desktop/Inbox')
网友评论