图片来源:https://www.pixiv.net/en/artworks/101379672 使用POSIX函数 其中 使用C++ 17新增的filesystem库 参考: Programming Linux下C++遍历文件夹