| 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 | 10 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 // TODO(erikkay): is this OK? | 274 // TODO(erikkay): is this OK? |
| 275 // If success, return true and output the full path of the directory created. | 275 // If success, return true and output the full path of the directory created. |
| 276 bool CreateNewTempDirectory(const FilePath::StringType& prefix, | 276 bool CreateNewTempDirectory(const FilePath::StringType& prefix, |
| 277 FilePath* new_temp_path); | 277 FilePath* new_temp_path); |
| 278 | 278 |
| 279 // Creates a directory, as well as creating any parent directories, if they | 279 // Creates a directory, as well as creating any parent directories, if they |
| 280 // don't exist. Returns 'true' on successful creation, or if the directory | 280 // don't exist. Returns 'true' on successful creation, or if the directory |
| 281 // already exists. The directory is only readable by the current user. | 281 // already exists. The directory is only readable by the current user. |
| 282 bool CreateDirectory(const FilePath& full_path); | 282 bool CreateDirectory(const FilePath& full_path); |
| 283 | 283 |
| 284 #if defined(OS_WIN) |
| 285 // Added for debugging an issue where CreateDirectory() fails. LOG(*) does |
| 286 // not work, because the failure happens in a sandboxed process. |
| 287 // TODO(skerner): Remove once crbug/35198 is resolved. |
| 288 bool CreateDirectoryExtraLogging(const FilePath& full_path, |
| 289 std::ostream& error); |
| 290 #endif // defined (OS_WIN) |
| 291 |
| 284 // Returns the file size. Returns true on success. | 292 // Returns the file size. Returns true on success. |
| 285 bool GetFileSize(const FilePath& file_path, int64* file_size); | 293 bool GetFileSize(const FilePath& file_path, int64* file_size); |
| 286 | 294 |
| 287 // Returns true if the given path's base name is ".". | 295 // Returns true if the given path's base name is ".". |
| 288 bool IsDot(const FilePath& path); | 296 bool IsDot(const FilePath& path); |
| 289 | 297 |
| 290 // Returns true if the given path's base name is "..". | 298 // Returns true if the given path's base name is "..". |
| 291 bool IsDotDot(const FilePath& path); | 299 bool IsDotDot(const FilePath& path); |
| 292 | 300 |
| 293 // Sets |real_path| to |path| with symbolic links and junctions expanded. | 301 // Sets |real_path| to |path| with symbolic links and junctions expanded. |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 | 596 |
| 589 #endif // UNIT_TEST | 597 #endif // UNIT_TEST |
| 590 | 598 |
| 591 } // namespace file_util | 599 } // namespace file_util |
| 592 | 600 |
| 593 // Deprecated functions have been moved to this separate header file, | 601 // Deprecated functions have been moved to this separate header file, |
| 594 // which must be included last after all the above definitions. | 602 // which must be included last after all the above definitions. |
| 595 #include "base/file_util_deprecated.h" | 603 #include "base/file_util_deprecated.h" |
| 596 | 604 |
| 597 #endif // BASE_FILE_UTIL_H_ | 605 #endif // BASE_FILE_UTIL_H_ |
| OLD | NEW |