| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // Similar to CreateAndOpenTemporaryFile, but the file is created in |dir|. | 261 // Similar to CreateAndOpenTemporaryFile, but the file is created in |dir|. |
| 262 FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path); | 262 FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path); |
| 263 | 263 |
| 264 // Same as CreateTemporaryFile but the file is created in |dir|. | 264 // Same as CreateTemporaryFile but the file is created in |dir|. |
| 265 bool CreateTemporaryFileInDir(const FilePath& dir, | 265 bool CreateTemporaryFileInDir(const FilePath& dir, |
| 266 FilePath* temp_file); | 266 FilePath* temp_file); |
| 267 | 267 |
| 268 // Create a directory within another directory. | 268 // Create a directory within another directory. |
| 269 // Extra characters will be appended to |name_tmpl| to ensure that the | 269 // Extra characters will be appended to |name_tmpl| to ensure that the |
| 270 // new directory does not have the same name as an existing directory. | 270 // new directory does not have the same name as an existing directory. |
| 271 // If |loosen_permissions| is true, the new directory will be readable | |
| 272 // and writable to all users on windows. It is ignored on other platforms. | |
| 273 // |loosen_permissions| exists to allow debugging of crbug/35198, and will | |
| 274 // be removed when the issue is understood. | |
| 275 bool CreateTemporaryDirInDir(const FilePath& base_dir, | 271 bool CreateTemporaryDirInDir(const FilePath& base_dir, |
| 276 const FilePath::StringType& prefix, | 272 const FilePath::StringType& prefix, |
| 277 bool loosen_permissions, | |
| 278 FilePath* new_dir); | 273 FilePath* new_dir); |
| 279 | 274 |
| 280 // Create a new directory under TempPath. If prefix is provided, the new | 275 // Create a new directory under TempPath. If prefix is provided, the new |
| 281 // directory name is in the format of prefixyyyy. | 276 // directory name is in the format of prefixyyyy. |
| 282 // NOTE: prefix is ignored in the POSIX implementation. | 277 // NOTE: prefix is ignored in the POSIX implementation. |
| 283 // TODO(erikkay): is this OK? | 278 // TODO(erikkay): is this OK? |
| 284 // If success, return true and output the full path of the directory created. | 279 // If success, return true and output the full path of the directory created. |
| 285 bool CreateNewTempDirectory(const FilePath::StringType& prefix, | 280 bool CreateNewTempDirectory(const FilePath::StringType& prefix, |
| 286 FilePath* new_temp_path); | 281 FilePath* new_temp_path); |
| 287 | 282 |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 bool PreReadImage(const wchar_t* file_path, size_t size_to_read, | 610 bool PreReadImage(const wchar_t* file_path, size_t size_to_read, |
| 616 size_t step_size); | 611 size_t step_size); |
| 617 #endif // OS_WIN | 612 #endif // OS_WIN |
| 618 } // namespace file_util | 613 } // namespace file_util |
| 619 | 614 |
| 620 // Deprecated functions have been moved to this separate header file, | 615 // Deprecated functions have been moved to this separate header file, |
| 621 // which must be included last after all the above definitions. | 616 // which must be included last after all the above definitions. |
| 622 #include "base/file_util_deprecated.h" | 617 #include "base/file_util_deprecated.h" |
| 623 | 618 |
| 624 #endif // BASE_FILE_UTIL_H_ | 619 #endif // BASE_FILE_UTIL_H_ |
| OLD | NEW |