OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FILES_FILE_UTIL_H_ | 8 #ifndef BASE_FILES_FILE_UTIL_H_ |
9 #define BASE_FILES_FILE_UTIL_H_ | 9 #define BASE_FILES_FILE_UTIL_H_ |
10 | 10 |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 414 |
415 // Internal -------------------------------------------------------------------- | 415 // Internal -------------------------------------------------------------------- |
416 | 416 |
417 namespace internal { | 417 namespace internal { |
418 | 418 |
419 // Same as Move but allows paths with traversal components. | 419 // Same as Move but allows paths with traversal components. |
420 // Use only with extreme care. | 420 // Use only with extreme care. |
421 BASE_EXPORT bool MoveUnsafe(const FilePath& from_path, | 421 BASE_EXPORT bool MoveUnsafe(const FilePath& from_path, |
422 const FilePath& to_path); | 422 const FilePath& to_path); |
423 | 423 |
424 // Same as CopyFile but allows paths with traversal components. | |
425 // Use only with extreme care. | |
426 BASE_EXPORT bool CopyFileUnsafe(const FilePath& from_path, | |
427 const FilePath& to_path); | |
428 | |
429 #if defined(OS_WIN) | 424 #if defined(OS_WIN) |
430 // Copy from_path to to_path recursively and then delete from_path recursively. | 425 // Copy from_path to to_path recursively and then delete from_path recursively. |
431 // Returns true if all operations succeed. | 426 // Returns true if all operations succeed. |
432 // This function simulates Move(), but unlike Move() it works across volumes. | 427 // This function simulates Move(), but unlike Move() it works across volumes. |
433 // This function is not transactional. | 428 // This function is not transactional. |
434 BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path, | 429 BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path, |
435 const FilePath& to_path); | 430 const FilePath& to_path); |
436 #endif // defined(OS_WIN) | 431 #endif // defined(OS_WIN) |
437 | 432 |
438 } // namespace internal | 433 } // namespace internal |
439 } // namespace base | 434 } // namespace base |
440 | 435 |
441 #endif // BASE_FILES_FILE_UTIL_H_ | 436 #endif // BASE_FILES_FILE_UTIL_H_ |
OLD | NEW |