MCPcopy Create free account
hub / github.com/cvmfs/cvmfs / SafeWriteToFile

Function SafeWriteToFile

cvmfs/util/posix.cc:2179–2188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2177}
2178
2179bool SafeWriteToFile(const std::string &content,
2180 const std::string &path,
2181 int mode) {
2182 const int fd = open(path.c_str(), O_WRONLY | O_CREAT | O_TRUNC, mode);
2183 if (fd < 0)
2184 return false;
2185 const bool retval = SafeWrite(fd, content.data(), content.size());
2186 close(fd);
2187 return retval;
2188}
2189
2190
2191#ifdef CVMFS_NAMESPACE_GUARD

Callers 15

ResolveProxyDescriptionFunction · 0.85
MainMethod · 0.85
RunMethod · 0.85
AcquireMethod · 0.85
MainMethod · 0.85
WriteCvmfsConfigMethod · 0.85
MainMethod · 0.85
MainMethod · 0.85
SaveAsMethod · 0.85
ExportKeychainMethod · 0.85
TEST_FFunction · 0.85

Calls 4

SafeWriteFunction · 0.85
c_strMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45

Tested by 6

TestWithContentMethod · 0.68
SetUpMethod · 0.68
CreateManifestMethod · 0.68
CreateWhitelistMethod · 0.68
CreateKeysMethod · 0.68