}
- bool
- checkNormalFile(const string& Path_Cv)
- {
- struct stat Stat_ri;
- return stat(Path_Cv.c_str(), &Stat_ri) >= 0 && S_ISREG(Stat_ri.st_mode);
- }
-
-
- bool
- checkAnything(const string& Path_Cv)
- {
- struct stat Stat_ri;
- return stat(Path_Cv.c_str(), &Stat_ri) >= 0;
- }
-
-
list<string>
glob(const string& path, int flags)
{
using std::vector;
- bool checkNormalFile(const string& Path_Cv);
bool checkDir(const string& Path_Cv);
- bool checkAnything(const string& Path_Cv);
list<string> glob(const string& path, int flags);
bool
Ext4::checkSnapshot(unsigned int num) const
{
- return checkNormalFile(snapshotFile(num));
+ struct stat stat;
+ int r1 = ::stat(snapshotFile(num).c_str(), &stat);
+ return r1 == 0 && S_ISREG(stat.st_mode);
}
// ENABLE_EXT4
#endif
bool
Lvm::checkSnapshot(unsigned int num) const
{
- return checkAnything(getDevice(num));
+ struct stat stat;
+ int r1 = ::stat(getDevice(num).c_str(), &stat);
+ return r1 == 0 && S_ISBLK(stat.st_mode);
}