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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // Get the home directory. This is more complicated than just getenv("HOME") | 232 // Get the home directory. This is more complicated than just getenv("HOME") |
233 // as it knows to fall back on getpwent() etc. | 233 // as it knows to fall back on getpwent() etc. |
234 FilePath GetHomeDir(); | 234 FilePath GetHomeDir(); |
235 | 235 |
236 // Creates a temporary file. The full path is placed in |path|, and the | 236 // Creates a temporary file. The full path is placed in |path|, and the |
237 // function returns true if was successful in creating the file. The file will | 237 // function returns true if was successful in creating the file. The file will |
238 // be empty and all handles closed after this function returns. | 238 // be empty and all handles closed after this function returns. |
239 bool CreateTemporaryFile(FilePath* path); | 239 bool CreateTemporaryFile(FilePath* path); |
240 | 240 |
241 // Create and open a temporary file. File is opened for read/write. | 241 // Create and open a temporary file. File is opened for read/write. |
242 // The full path is placed in |path|, and the function returns true if | 242 // The full path is placed in |path|. |
243 // was successful in creating and opening the file. | 243 // Returns a handle to the opened file or NULL if an error occured. |
244 FILE* CreateAndOpenTemporaryFile(FilePath* path); | 244 FILE* CreateAndOpenTemporaryFile(FilePath* path); |
245 // Like above but for shmem files. Only useful for POSIX. | 245 // Like above but for shmem files. Only useful for POSIX. |
246 FILE* CreateAndOpenTemporaryShmemFile(FilePath* path); | 246 FILE* CreateAndOpenTemporaryShmemFile(FilePath* path); |
247 | 247 |
248 // Similar to CreateAndOpenTemporaryFile, but the file is created in |dir|. | 248 // Similar to CreateAndOpenTemporaryFile, but the file is created in |dir|. |
249 FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path); | 249 FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir, FilePath* path); |
250 | 250 |
251 // Same as CreateTemporaryFile but the file is created in |dir|. | 251 // Same as CreateTemporaryFile but the file is created in |dir|. |
252 bool CreateTemporaryFileInDir(const FilePath& dir, | 252 bool CreateTemporaryFileInDir(const FilePath& dir, |
253 FilePath* temp_file); | 253 FilePath* temp_file); |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 | 578 |
579 #endif // UNIT_TEST | 579 #endif // UNIT_TEST |
580 | 580 |
581 } // namespace file_util | 581 } // namespace file_util |
582 | 582 |
583 // Deprecated functions have been moved to this separate header file, | 583 // Deprecated functions have been moved to this separate header file, |
584 // which must be included last after all the above definitions. | 584 // which must be included last after all the above definitions. |
585 #include "base/file_util_deprecated.h" | 585 #include "base/file_util_deprecated.h" |
586 | 586 |
587 #endif // BASE_FILE_UTIL_H_ | 587 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |