MCPcopy Create free account
hub / github.com/catboost/catboost / SetExecutable

Method SetExecutable

util/system/fs.cpp:27–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27bool NFs::SetExecutable(const TString& path, bool exec) {
28#ifdef _unix_
29 TFileStat stat(path);
30 ui32 mode = stat.Mode;
31 if (exec) {
32 mode |= S_IXUSR | S_IXGRP | S_IXOTH;
33 } else {
34 mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH);
35 }
36 if (stat.Mode != 0 && mode != stat.Mode) {
37 return !Chmod(path.c_str(), mode);
38 }
39#endif
40 Y_UNUSED(exec);
41 Y_UNUSED(path);
42 return true;
43}
44
45void NFs::RemoveRecursive(const TString& path) {
46 static const TStringBuf errStr = "error while removing ";

Callers

nothing calls this directly

Calls 3

Y_UNUSEDFunction · 0.85
ChmodFunction · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected