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_FILE_UTIL_H_ | 8 #ifndef BASE_FILE_UTIL_H_ |
9 #define BASE_FILE_UTIL_H_ | 9 #define BASE_FILE_UTIL_H_ |
10 | 10 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 // instead of this function. Those variants will ensure that the proper | 209 // instead of this function. Those variants will ensure that the proper |
210 // permissions are set so that other users on the system can't edit them while | 210 // permissions are set so that other users on the system can't edit them while |
211 // they're open (which can lead to security issues). | 211 // they're open (which can lead to security issues). |
212 BASE_EXPORT bool GetTempDir(FilePath* path); | 212 BASE_EXPORT bool GetTempDir(FilePath* path); |
213 | 213 |
214 // Get the home directory. This is more complicated than just getenv("HOME") | 214 // Get the home directory. This is more complicated than just getenv("HOME") |
215 // as it knows to fall back on getpwent() etc. | 215 // as it knows to fall back on getpwent() etc. |
216 // | 216 // |
217 // You should not generally call this directly. Instead use DIR_HOME with the | 217 // You should not generally call this directly. Instead use DIR_HOME with the |
218 // path service which will use this function but cache the value. | 218 // path service which will use this function but cache the value. |
219 // Path service may as well override DIR_HOME. | |
wtc
2014/04/22 22:26:55
Nit: change "as well" to "also", or put "as well"
Nikita (slow)
2014/04/23 04:48:08
Done.
| |
219 BASE_EXPORT FilePath GetHomeDir(); | 220 BASE_EXPORT FilePath GetHomeDir(); |
220 | 221 |
221 // Creates a temporary file. The full path is placed in |path|, and the | 222 // Creates a temporary file. The full path is placed in |path|, and the |
222 // function returns true if was successful in creating the file. The file will | 223 // function returns true if was successful in creating the file. The file will |
223 // be empty and all handles closed after this function returns. | 224 // be empty and all handles closed after this function returns. |
224 BASE_EXPORT bool CreateTemporaryFile(FilePath* path); | 225 BASE_EXPORT bool CreateTemporaryFile(FilePath* path); |
225 | 226 |
226 // Same as CreateTemporaryFile but the file is created in |dir|. | 227 // Same as CreateTemporaryFile but the file is created in |dir|. |
227 BASE_EXPORT bool CreateTemporaryFileInDir(const FilePath& dir, | 228 BASE_EXPORT bool CreateTemporaryFileInDir(const FilePath& dir, |
228 FilePath* temp_file); | 229 FilePath* temp_file); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 // This function simulates Move(), but unlike Move() it works across volumes. | 444 // This function simulates Move(), but unlike Move() it works across volumes. |
444 // This function is not transactional. | 445 // This function is not transactional. |
445 BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path, | 446 BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path, |
446 const FilePath& to_path); | 447 const FilePath& to_path); |
447 #endif // defined(OS_WIN) | 448 #endif // defined(OS_WIN) |
448 | 449 |
449 } // namespace internal | 450 } // namespace internal |
450 } // namespace base | 451 } // namespace base |
451 | 452 |
452 #endif // BASE_FILE_UTIL_H_ | 453 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |