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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 // the number of read bytes, or -1 on error. | 360 // the number of read bytes, or -1 on error. |
361 int ReadFile(const FilePath& filename, char* data, int size); | 361 int ReadFile(const FilePath& filename, char* data, int size); |
362 // Deprecated temporary compatibility function. | 362 // Deprecated temporary compatibility function. |
363 int ReadFile(const std::wstring& filename, char* data, int size); | 363 int ReadFile(const std::wstring& filename, char* data, int size); |
364 | 364 |
365 // Writes the given buffer into the file, overwriting any data that was | 365 // Writes the given buffer into the file, overwriting any data that was |
366 // previously there. Returns the number of bytes written, or -1 on error. | 366 // previously there. Returns the number of bytes written, or -1 on error. |
367 int WriteFile(const FilePath& filename, const char* data, int size); | 367 int WriteFile(const FilePath& filename, const char* data, int size); |
368 // Deprecated temporary compatibility function. | 368 // Deprecated temporary compatibility function. |
369 int WriteFile(const std::wstring& filename, const char* data, int size); | 369 int WriteFile(const std::wstring& filename, const char* data, int size); |
| 370 #if defined(OS_POSIX) |
| 371 // Append the data to |fd|. Does not close |fd| when done. |
| 372 int WriteFileDescriptor(const int fd, const char* data, int size); |
| 373 #endif |
370 | 374 |
371 // Gets the current working directory for the process. | 375 // Gets the current working directory for the process. |
372 bool GetCurrentDirectory(FilePath* path); | 376 bool GetCurrentDirectory(FilePath* path); |
373 // Deprecated temporary compatibility function. | 377 // Deprecated temporary compatibility function. |
374 bool GetCurrentDirectory(std::wstring* path); | 378 bool GetCurrentDirectory(std::wstring* path); |
375 | 379 |
376 // Sets the current working directory for the process. | 380 // Sets the current working directory for the process. |
377 bool SetCurrentDirectory(const FilePath& path); | 381 bool SetCurrentDirectory(const FilePath& path); |
378 // Deprecated temporary compatibility function. | 382 // Deprecated temporary compatibility function. |
379 bool SetCurrentDirectory(const std::wstring& current_directory); | 383 bool SetCurrentDirectory(const std::wstring& current_directory); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 | 546 |
543 // Renames a file using the SHFileOperation API to ensure that the target file | 547 // Renames a file using the SHFileOperation API to ensure that the target file |
544 // gets the correct default security descriptor in the new path. | 548 // gets the correct default security descriptor in the new path. |
545 bool RenameFileAndResetSecurityDescriptor( | 549 bool RenameFileAndResetSecurityDescriptor( |
546 const FilePath& source_file_path, | 550 const FilePath& source_file_path, |
547 const FilePath& target_file_path); | 551 const FilePath& target_file_path); |
548 | 552 |
549 } // namespace file_util | 553 } // namespace file_util |
550 | 554 |
551 #endif // BASE_FILE_UTIL_H_ | 555 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |