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')
Node 获取指定文件夹下的文件夹和文件
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 整体思路:传递文件夹名称、Sheet名称、列和行的数字自动获取该文件夹下的文件名称 在具体需要提取页面中,使用双击...
- 【引用位置】https://blog.csdn.net/pashine/article/details/42100...
- 先上结果: 你要添加的控件有:Button, textBox(把MultiLine属性设置为True), Fold...