Lines Matching refs:path
53 // Deletes all files and directories in a path.
56 DWORD DeleteFileRecursive(const FilePath& path,
59 FileEnumerator traversal(path, false,
101 DWORD DoDeleteFile(const FilePath& path, bool recursive) {
102 if (path.empty())
105 if (path.value().length() >= MAX_PATH)
108 // Handle any path with wildcards.
109 if (path.BaseName().value().find_first_of(u"*?") !=
111 return DeleteFileRecursive(path.DirName(), path.BaseName().value(),
115 // Report success if the file or path does not exist.
116 const DWORD attr = ::GetFileAttributes(ToWCharT(&path.value()));
127 !::SetFileAttributes(ToWCharT(&path.value()),
134 return ::DeleteFile(ToWCharT(&path.value())) ? ERROR_SUCCESS
139 const DWORD error_code = DeleteFileRecursive(path, u"*", true);
143 return ::RemoveDirectory(ToWCharT(&path.value())) ? ERROR_SUCCESS
200 bool DeleteFile(const FilePath& path, bool recursive) {
209 const DWORD error = DoDeleteFile(path, recursive);
213 bool DeleteFileAfterReboot(const FilePath& path) {
214 if (path.value().length() >= MAX_PATH)
217 return MoveFileEx(ToWCharT(&path.value()), NULL,
250 bool PathExists(const FilePath& path) {
251 return (GetFileAttributes(ToWCharT(&path.value())) !=
255 bool PathIsWritable(const FilePath& path) {
257 CreateFile(ToWCharT(&path.value()), FILE_ADD_FILE, kFileShareAll, NULL,
267 bool DirectoryExists(const FilePath& path) {
268 DWORD fileattr = GetFileAttributes(ToWCharT(&path.value()));
274 bool GetTempDir(FilePath* path) {
282 *path = FilePath(temp_path).StripTrailingSeparators();
337 // the one exists, keep trying another path name until we reach some limit.
364 // If the path exists, we've succeeded if it's a directory, failed otherwise.
403 // with the same path. If DirectoryExists() returns true, we lost the
419 bool NormalizeFilePath(const FilePath& path, FilePath* real_path) {
421 if (!NormalizeToNativeFilePath(path, &mapped_file))
423 // NormalizeToNativeFilePath() will return a path that starts with
425 // will find a drive letter which maps to the path's device, so
426 // that we return a path starting with a drive letter.
449 // know that |drive| is the real path prefix.
470 // No drive matched. The path does not start with a device junction
472 // letter path to the volume that holds |device_path|, so fail.
476 bool NormalizeToNativeFilePath(const FilePath& path, FilePath* nt_path) {
477 // In Vista, GetFinalPathNameByHandle() would give us the real path
483 ::CreateFile(ToWCharT(&path.value()), GENERIC_READ, kFileShareAll, NULL,
498 // Use a view of the file to get the path to the file.
504 // The expansion of |path| into a full path may make it longer.
509 // path fit in |mapped_file_path|.
595 DPLOG(WARNING) << "CreateFile failed for path "
651 int GetMaximumPathComponentLength(const FilePath& path) {
653 if (!GetVolumePathNameW(ToWCharT(&path.NormalizePathSeparators().value()),
664 // Length of |path| with path separator appended.
665 size_t prefix = path.StripTrailingSeparators().value().size() + 1;
666 // The whole path string must be shorter than MAX_PATH. That is, it must be