| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file contains utility functions for dealing with the local | 5 // This file contains utility functions for dealing with the local |
| 6 // filesystem. | 6 // filesystem. |
| 7 | 7 |
| 8 #ifndef BASE_FILE_UTIL_H_ | 8 #ifndef BASE_FILE_UTIL_H_ |
| 9 #define BASE_FILE_UTIL_H_ | 9 #define BASE_FILE_UTIL_H_ |
| 10 #pragma once | 10 #pragma once |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 // new directory does not have the same name as an existing directory. | 275 // new directory does not have the same name as an existing directory. |
| 276 bool CreateTemporaryDirInDir(const FilePath& base_dir, | 276 bool CreateTemporaryDirInDir(const FilePath& base_dir, |
| 277 const FilePath::StringType& prefix, | 277 const FilePath::StringType& prefix, |
| 278 FilePath* new_dir); | 278 FilePath* new_dir); |
| 279 | 279 |
| 280 // Creates a directory, as well as creating any parent directories, if they | 280 // Creates a directory, as well as creating any parent directories, if they |
| 281 // don't exist. Returns 'true' on successful creation, or if the directory | 281 // don't exist. Returns 'true' on successful creation, or if the directory |
| 282 // already exists. The directory is only readable by the current user. | 282 // already exists. The directory is only readable by the current user. |
| 283 bool CreateDirectory(const FilePath& full_path); | 283 bool CreateDirectory(const FilePath& full_path); |
| 284 | 284 |
| 285 #if defined(OS_WIN) | |
| 286 // Added for debugging an issue where CreateDirectory() fails. LOG(*) does | |
| 287 // not work, because the failure happens in a sandboxed process. | |
| 288 // TODO(skerner): Remove once crbug/35198 is resolved. | |
| 289 bool CreateDirectoryExtraLogging(const FilePath& full_path, | |
| 290 std::ostream& error); | |
| 291 #endif // defined (OS_WIN) | |
| 292 | |
| 293 // Returns the file size. Returns true on success. | 285 // Returns the file size. Returns true on success. |
| 294 bool GetFileSize(const FilePath& file_path, int64* file_size); | 286 bool GetFileSize(const FilePath& file_path, int64* file_size); |
| 295 | 287 |
| 296 // Returns true if the given path's base name is ".". | 288 // Returns true if the given path's base name is ".". |
| 297 bool IsDot(const FilePath& path); | 289 bool IsDot(const FilePath& path); |
| 298 | 290 |
| 299 // Returns true if the given path's base name is "..". | 291 // Returns true if the given path's base name is "..". |
| 300 bool IsDotDot(const FilePath& path); | 292 bool IsDotDot(const FilePath& path); |
| 301 | 293 |
| 302 // Sets |real_path| to |path| with symbolic links and junctions expanded. | 294 // Sets |real_path| to |path| with symbolic links and junctions expanded. |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 bool GetFileSystemType(const FilePath& path, FileSystemType* type); | 613 bool GetFileSystemType(const FilePath& path, FileSystemType* type); |
| 622 #endif | 614 #endif |
| 623 | 615 |
| 624 } // namespace file_util | 616 } // namespace file_util |
| 625 | 617 |
| 626 // Deprecated functions have been moved to this separate header file, | 618 // Deprecated functions have been moved to this separate header file, |
| 627 // which must be included last after all the above definitions. | 619 // which must be included last after all the above definitions. |
| 628 #include "base/file_util_deprecated.h" | 620 #include "base/file_util_deprecated.h" |
| 629 | 621 |
| 630 #endif // BASE_FILE_UTIL_H_ | 622 #endif // BASE_FILE_UTIL_H_ |
| OLD | NEW |