| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 bool CopyDirectory(const std::wstring& from_path, const std::wstring& to_path, | 144 bool CopyDirectory(const std::wstring& from_path, const std::wstring& to_path, |
| 145 bool recursive); | 145 bool recursive); |
| 146 | 146 |
| 147 // Returns true if the given path exists on the local filesystem, | 147 // Returns true if the given path exists on the local filesystem, |
| 148 // false otherwise. | 148 // false otherwise. |
| 149 bool PathExists(const std::wstring& path); | 149 bool PathExists(const std::wstring& path); |
| 150 | 150 |
| 151 // Returns true if the given path is writable by the user, false otherwise. | 151 // Returns true if the given path is writable by the user, false otherwise. |
| 152 bool PathIsWritable(const std::wstring& path); | 152 bool PathIsWritable(const std::wstring& path); |
| 153 | 153 |
| 154 // Returns true if the given path exists and is a directory, false otherwise. |
| 155 bool DirectoryExists(const std::wstring& path); |
| 156 |
| 154 #if defined(OS_WIN) | 157 #if defined(OS_WIN) |
| 155 // Gets the creation time of the given file (expressed in the local timezone), | 158 // Gets the creation time of the given file (expressed in the local timezone), |
| 156 // and returns it via the creation_time parameter. Returns true if successful, | 159 // and returns it via the creation_time parameter. Returns true if successful, |
| 157 // false otherwise. | 160 // false otherwise. |
| 158 bool GetFileCreationLocalTime(const std::wstring& filename, | 161 bool GetFileCreationLocalTime(const std::wstring& filename, |
| 159 LPSYSTEMTIME creation_time); | 162 LPSYSTEMTIME creation_time); |
| 160 | 163 |
| 161 // Same as above, but takes a previously-opened file handle instead of a name. | 164 // Same as above, but takes a previously-opened file handle instead of a name. |
| 162 bool GetFileCreationLocalTimeFromHandle(HANDLE file_handle, | 165 bool GetFileCreationLocalTimeFromHandle(HANDLE file_handle, |
| 163 LPSYSTEMTIME creation_time); | 166 LPSYSTEMTIME creation_time); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 317 |
| 315 // Renames a file using the MoveFileEx API and ensures that the target file gets | 318 // Renames a file using the MoveFileEx API and ensures that the target file gets |
| 316 // the correct security descriptor in the new path. | 319 // the correct security descriptor in the new path. |
| 317 bool RenameFileAndResetSecurityDescriptor( | 320 bool RenameFileAndResetSecurityDescriptor( |
| 318 const std::wstring& source_file_path, | 321 const std::wstring& source_file_path, |
| 319 const std::wstring& target_file_path); | 322 const std::wstring& target_file_path); |
| 320 | 323 |
| 321 } // namespace file_util | 324 } // namespace file_util |
| 322 | 325 |
| 323 #endif // BASE_FILE_UTIL_H_ | 326 #endif // BASE_FILE_UTIL_H_ |
| OLD | NEW |