Lines Matching refs:path
49 bool ReadFileToString(const std::string& path, std::string* content) { in ReadFileToString() argument
52 int fd = TEMP_FAILURE_RETRY(open(path.c_str(), O_RDONLY | O_CLOEXEC | O_NOFOLLOW | O_BINARY)); in ReadFileToString()
75 static bool CleanUpAfterFailedWrite(const std::string& path) { in CleanUpAfterFailedWrite() argument
78 unlink(path.c_str()); in CleanUpAfterFailedWrite()
84 bool WriteStringToFile(const std::string& content, const std::string& path, in WriteStringToFile() argument
87 int fd = TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode)); in WriteStringToFile()
97 return CleanUpAfterFailedWrite(path); in WriteStringToFile()
101 return CleanUpAfterFailedWrite(path); in WriteStringToFile()
105 return CleanUpAfterFailedWrite(path); in WriteStringToFile()
112 bool WriteStringToFile(const std::string& content, const std::string& path) { in WriteStringToFile() argument
114 int fd = TEMP_FAILURE_RETRY(open(path.c_str(), flags, DEFFILEMODE)); in WriteStringToFile()
121 return result || CleanUpAfterFailedWrite(path); in WriteStringToFile()
148 bool RemoveFileIfExists(const std::string& path, std::string* err) { in RemoveFileIfExists() argument
152 int result = stat(path.c_str(), &st); in RemoveFileIfExists()
155 int result = lstat(path.c_str(), &st); in RemoveFileIfExists()
165 if (unlink(path.c_str()) == -1) { in RemoveFileIfExists()