Lines Matching defs:path

55 extern "C" char* mkdtemp(char* path);
65 int CallStat(const char* path, stat_wrapper_t* sb) {
66 return stat(path, sb);
68 int CallLstat(const char* path, stat_wrapper_t* sb) {
69 return lstat(path, sb);
72 int CallStat(const char* path, stat_wrapper_t* sb) {
73 return stat64(path, sb);
75 int CallLstat(const char* path, stat_wrapper_t* sb) {
76 return lstat64(path, sb);
81 bool VerifySpecificPathControlledByUser(const FilePath& path,
85 if (CallLstat(path.value().c_str(), &stat_info) != 0) {
86 DPLOG(ERROR) << "Failed to get information on path " << path.value();
91 DLOG(ERROR) << "Path " << path.value() << " is a symbolic link.";
96 DLOG(ERROR) << "Path " << path.value() << " is owned by the wrong user.";
102 DLOG(ERROR) << "Path " << path.value()
108 DLOG(ERROR) << "Path " << path.value() << " is writable by any user.";
173 bool DeleteFile(const FilePath& path, bool recursive) {
174 const char* path_str = path.value().c_str();
187 directories.push(path.value());
188 FileEnumerator traversal(path, true,
262 bool PathExists(const FilePath& path) {
263 return access(path.value().c_str(), F_OK) == 0;
266 bool PathIsWritable(const FilePath& path) {
267 return access(path.value().c_str(), W_OK) == 0;
270 bool DirectoryExists(const FilePath& path) {
272 if (CallStat(path.value().c_str(), &file_info) != 0)
278 FilePath* path) {
279 *path = directory.Append(TempFileName());
280 const std::string& tmpdir_string = path->value();
311 bool GetPosixFilePermissions(const FilePath& path, int* mode) {
317 if (CallStat(path.value().c_str(), &file_info) != 0)
324 bool SetPosixFilePermissions(const FilePath& path, int mode) {
329 if (CallStat(path.value().c_str(), &stat_buf) != 0)
336 if (HANDLE_EINTR(chmod(path.value().c_str(), updated_mode_bits)) != 0)
344 std::string path;
345 if (!env->GetVar("PATH", &path)) {
351 SplitStringPiece(path, ":", KEEP_WHITESPACE, SPLIT_WANT_NONEMPTY)) {
363 bool GetTempDir(FilePath* path) {
366 *path = FilePath(tmp);
370 *path = FilePath("/tmp");
451 for (FilePath path = full_path.DirName(); path.value() != last_path.value();
452 path = path.DirName()) {
453 subpaths.push_back(path);
454 last_path = path;
478 bool NormalizeFilePath(const FilePath& path, FilePath* normalized_path) {
479 FilePath real_path_result = MakeAbsoluteFilePath(path);
610 bool SetCurrentDirectory(const FilePath& path) {
611 return chdir(path.value().c_str()) == 0;
615 const FilePath& path,
618 if (base != path && !base.IsParent(path)) {
619 DLOG(ERROR) << "|base| must be a subdirectory of |path|. base = \""
620 << base.value() << "\", path = \"" << path.value() << "\"";
628 path.GetComponents(&path_components);
633 // |base| must be a subpath of |path|, so all components should match.
635 // path at the top of this function.
654 bool VerifyPathControlledByAdmin(const FilePath& path) {
673 return VerifyPathControlledByUser(kFileSystemRoot, path, kRootUid,
678 int GetMaximumPathComponentLength(const FilePath& path) {
679 return pathconf(path.value().c_str(), _PC_NAME_MAX);