MCPcopy Create free account
hub / github.com/Kitware/CMake / FileModeGuard

Method FileModeGuard

Source/cmSystemTools.cxx:1265–1281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1263};
1264
1265FileModeGuard::FileModeGuard(std::string const& file_path, std::string* emsg)
1266{
1267#ifndef _WIN32
1268 struct stat file_stat;
1269 if (stat(file_path.c_str(), &file_stat) != 0) {
1270 if (emsg) {
1271 *emsg = cmStrCat("Cannot get file stat: ", strerror(errno));
1272 }
1273 return;
1274 }
1275
1276 mode_ = file_stat.st_mode;
1277#else
1278 static_cast<void>(emsg);
1279#endif
1280 filepath_ = file_path;
1281}
1282
1283bool FileModeGuard::Restore(std::string* emsg)
1284{

Callers

nothing calls this directly

Calls 3

c_strMethod · 0.80
statClass · 0.70
cmStrCatFunction · 0.70

Tested by

no test coverage detected