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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // Similar to CreateAndOpenTemporaryFile, but the file is created in |dir|. | 258 // Similar to CreateAndOpenTemporaryFile, but the file is created in |dir|. |
259 FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path); | 259 FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path); |
260 | 260 |
261 // Same as CreateTemporaryFile but the file is created in |dir|. | 261 // Same as CreateTemporaryFile but the file is created in |dir|. |
262 bool CreateTemporaryFileInDir(const FilePath& dir, | 262 bool CreateTemporaryFileInDir(const FilePath& dir, |
263 FilePath* temp_file); | 263 FilePath* temp_file); |
264 | 264 |
265 // Create a directory within another directory. | 265 // Create a directory within another directory. |
266 // Extra characters will be appended to |name_tmpl| to ensure that the | 266 // Extra characters will be appended to |name_tmpl| to ensure that the |
267 // new directory does not have the same name as an existing directory. | 267 // new directory does not have the same name as an existing directory. |
| 268 // If |loosen_permissions| is true, the new directory will be readable |
| 269 // and writable to all users on windows. It is ignored on other platforms. |
| 270 // |loosen_permissions| exists to allow debugging of crbug/35198, and will |
| 271 // be removed when the issue is understood. |
268 bool CreateTemporaryDirInDir(const FilePath& base_dir, | 272 bool CreateTemporaryDirInDir(const FilePath& base_dir, |
269 const FilePath::StringType& prefix, | 273 const FilePath::StringType& prefix, |
| 274 bool loosen_permissions, |
270 FilePath* new_dir); | 275 FilePath* new_dir); |
271 | 276 |
272 // Create a new directory under TempPath. If prefix is provided, the new | 277 // Create a new directory under TempPath. If prefix is provided, the new |
273 // directory name is in the format of prefixyyyy. | 278 // directory name is in the format of prefixyyyy. |
274 // NOTE: prefix is ignored in the POSIX implementation. | 279 // NOTE: prefix is ignored in the POSIX implementation. |
275 // TODO(erikkay): is this OK? | 280 // TODO(erikkay): is this OK? |
276 // If success, return true and output the full path of the directory created. | 281 // If success, return true and output the full path of the directory created. |
277 bool CreateNewTempDirectory(const FilePath::StringType& prefix, | 282 bool CreateNewTempDirectory(const FilePath::StringType& prefix, |
278 FilePath* new_temp_path); | 283 FilePath* new_temp_path); |
279 | 284 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 | 603 |
599 #endif // UNIT_TEST | 604 #endif // UNIT_TEST |
600 | 605 |
601 } // namespace file_util | 606 } // namespace file_util |
602 | 607 |
603 // Deprecated functions have been moved to this separate header file, | 608 // Deprecated functions have been moved to this separate header file, |
604 // which must be included last after all the above definitions. | 609 // which must be included last after all the above definitions. |
605 #include "base/file_util_deprecated.h" | 610 #include "base/file_util_deprecated.h" |
606 | 611 |
607 #endif // BASE_FILE_UTIL_H_ | 612 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |