inline bool exists_file (const std::string& name) {
struct stat buffer;
return (stat ((char *)name.c_str(), &buffer) == 0);
}
返回1表示存在,0表示不存在
需要引入头文件
#include <sys/stat.h>
inline bool exists_file (const std::string& name) {
struct stat buffer;
return (stat ((char *)name.c_str(), &buffer) == 0);
}
返回1表示存在,0表示不存在
需要引入头文件
#include <sys/stat.h>