Linux下使用C++遍历文件夹 遍历目录
摘要:这个经常用到 保存一下 #include <stdio.h> #include <string.h> #include <sys/types.h> #include <dirent.h> #include <sys/stat.h> #include <string> #include <map> u
阅读全文
posted @
2021-03-12 11:33
弘道者
阅读(1432)
推荐(0)
bash遍历文件夹下面的文件
摘要:使用脚本遍历文件夹下面的文件 #!/bin/bash function read_dir(){ for file in `ls $1` #注意此处这是两个反引号,表示运行系统命令 do if [ -d $1"/"$file ] #注意此处之间一定要加上空格,否则会报错 then read_dir $
阅读全文
posted @
2021-03-11 17:30
弘道者
阅读(1489)
推荐(0)