Home | History | Annotate | Download | only in brillo

Lines Matching full:path

49   kFailure = 0,      // Failed to delete whatever was at the path.
51 kEmpty = 2 // Anything that was at the path has been deleted.
54 // Checks if a regular file owned by |uid| and |gid| exists at |path|, otherwise
55 // deletes anything that might be at |path|. Returns a RegularFileOrDeleteResult
56 // enum indicating what is at |path| after the function finishes.
57 RegularFileOrDeleteResult RegularFileOrDelete(const base::FilePath& path,
63 AT_FDCWD, path.value().c_str(), O_RDONLY | O_CLOEXEC | O_NOFOLLOW)));
66 // If there is a file/directory at |path|, see if it matches our criteria.
76 // If we get here and anything was at |path|, try to delete it so we can put
79 if (!base::DeleteFile(path, true)) {
80 PLOG(WARNING) << "Failed to delete entity at \"" << path.value() << '"';
90 // use the fd rather than the path. |fd_out| will only be set if a new file
94 bool TouchFileInternal(const base::FilePath& path,
98 RegularFileOrDeleteResult result = RegularFileOrDelete(path, uid, gid);
109 if (!base::CreateDirectory(path.DirName())) {
110 PLOG(WARNING) << "Failed to create directory for \"" << path.value() << '"';
117 path.value().c_str(),
121 PLOG(WARNING) << "Failed to create file \"" << path.value() << '"';
133 bool TouchFile(const base::FilePath& path,
144 if (!TouchFileInternal(path, uid, gid, &scoped_fd)) {
151 PLOG(WARNING) << "Failed to set permissions for \"" << path.value() << '"';
152 base::DeleteFile(path, false);
159 bool TouchFile(const base::FilePath& path) {
162 return TouchFile(path, kPermissions600, geteuid(), getegid());