• Home
  • Raw
  • Download

Lines Matching refs:path

39 FileEntry::FileEntry(const string &path)  in FileEntry()  argument
40 : filePath_(path), isFile_(false) in FileEntry()
113 bool FileEntry::Exist(const string &path) in Exist() argument
116 return PathFileExists(AdaptLongPath(path).c_str()); in Exist()
119 if (stat(path.c_str(), &s) != 0) { in Exist()
126 bool FileEntry::RemoveAllDir(const string &path) in RemoveAllDir() argument
128 FileEntry f(path); in RemoveAllDir()
134 cerr << "Error: RemoveAllDir '" << path << "' not directory." << endl; in RemoveAllDir()
140 bool FileEntry::CreateDirs(const string &path) in CreateDirs() argument
142 return CreateDirsInner(path, 0); in CreateDirs()
164 bool FileEntry::IsDirectory(const string &path) in IsDirectory() argument
167 if (!PathIsDirectory(AdaptLongPath(path).c_str())) { in IsDirectory()
173 stat(path.c_str(), &s); in IsDirectory()
178 string FileEntry::RealPath(const string &path) in RealPath() argument
182 if (!PathCanonicalize(buffer, path.c_str())) { in RealPath()
203 if (!realpath(path.c_str(), buffer)) { in RealPath()
213 FileEntry::FilePath::FilePath(const string &path) : filePath_(path) in FilePath() argument
223 FileEntry::FilePath FileEntry::FilePath::Append(const string &path) in Append() argument
226 string filePath = filePath_ + SEPARATE + path; in Append()
289 string path = entry.GetFilePath().GetPath(); in RemoveAllDirInner() local
292 bool result = remove(AdaptLongPath(path).c_str()) == 0; in RemoveAllDirInner()
294 bool result = remove(path.c_str()) == 0; in RemoveAllDirInner()
297 … cerr << "Error: remove file '" << path << "' failed, reason: " << strerror(errno) << endl; in RemoveAllDirInner()
309 bool result = rmdir(AdaptLongPath(path).c_str()) == 0; in RemoveAllDirInner()
311 bool result = rmdir(path.c_str()) == 0; in RemoveAllDirInner()
314 … cerr << "Error: remove directory '" << path << "' failed, reason: " << strerror(errno) << endl; in RemoveAllDirInner()
320 bool FileEntry::CreateDirsInner(const string &path, string::size_type offset) in CreateDirsInner() argument
322 string::size_type pos = path.find_first_of(SEPARATE.front(), offset); in CreateDirsInner()
325 return CreateDirectory(AdaptLongPath(path).c_str(), nullptr) != 0; in CreateDirsInner()
327 return mkdir(path.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0; in CreateDirsInner()
331 string subPath = path.substr(0, pos + 1); in CreateDirsInner()
341 return CreateDirsInner(path, pos + 1); in CreateDirsInner()
369 string FileEntry::AdaptLongPath(const string &path) in CreateDirsInner() argument
372 if (path.size() >= MAX_PATH -12) { //the max file path can not exceed 260 - 12 in CreateDirsInner()
373 return LONG_PATH_HEAD + path; in CreateDirsInner()
376 return path; in CreateDirsInner()