• Home
  • Raw
  • Download

Lines Matching refs:path

52 std::string FileUtils::ReadFile(const std::string& path)  in ReadFile()  argument
55 CHECK_TRUE((path.length() < PATH_MAX) && (realpath(path.c_str(), realPath) != nullptr), "", in ReadFile()
56 "%s:path is invalid: %s, errno=%d", __func__, path.c_str(), errno); in ReadFile()
62 PROFILER_LOG_WARN(LOG_CORE, "open file %s FAILED: %s!", path.c_str(), buf); in ReadFile()
66 CHECK_TRUE(close(fd) != -1, content, "close %s failed, %d", path.c_str(), errno); in ReadFile()
70 int FileUtils::WriteFile(const std::string& path, const std::string& content) in WriteFile() argument
72 return WriteFile(path, content, O_WRONLY); in WriteFile()
75 int FileUtils::WriteFile(const std::string& path, const std::string& content, int flags) in WriteFile() argument
77 return WriteFile(path, content, flags, 0); in WriteFile()
80 int FileUtils::WriteFile(const std::string& path, const std::string& content, int flags, int mode) in WriteFile() argument
82 CHECK_TRUE(!path.empty() && (path.length() < PATH_MAX), -1, in WriteFile()
83 "%s:path is invalid: %s, errno=%d", __func__, path.c_str(), errno); in WriteFile()
87 size_t pos = path.rfind("/"); in WriteFile()
89 std::string dirName = path.substr(0, pos+1); in WriteFile()
90 std::string fileName = path.substr(pos+1, path.length()-pos-1); in WriteFile()
92 "%s:path is invalid: %s, errno=%d", __func__, path.c_str(), errno); in WriteFile()
94 CHECK_TRUE(!std::regex_search(path, fileNameRegex), -1, in WriteFile()
95 "%s:path is invalid: %s, errno=%d", __func__, path.c_str(), errno); in WriteFile()
98 int fd = open(path.c_str(), flags, mode); in WriteFile()
99 CHECK_TRUE(fd >= 0, -1, "open %s failed, %d", path.c_str(), errno); in WriteFile()
102 CHECK_TRUE(close(fd) != -1, -1, "close %s failed, %d", path.c_str(), errno); in WriteFile()