Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: base/file_util.h

Issue 319543004: Move and rename FdopenPlatformFile to file_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/file_util_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 BASE_EXPORT bool TouchFile(const FilePath& path, 301 BASE_EXPORT bool TouchFile(const FilePath& path,
302 const Time& last_accessed, 302 const Time& last_accessed,
303 const Time& last_modified); 303 const Time& last_modified);
304 304
305 // Wrapper for fopen-like calls. Returns non-NULL FILE* on success. 305 // Wrapper for fopen-like calls. Returns non-NULL FILE* on success.
306 BASE_EXPORT FILE* OpenFile(const FilePath& filename, const char* mode); 306 BASE_EXPORT FILE* OpenFile(const FilePath& filename, const char* mode);
307 307
308 // Closes file opened by OpenFile. Returns true on success. 308 // Closes file opened by OpenFile. Returns true on success.
309 BASE_EXPORT bool CloseFile(FILE* file); 309 BASE_EXPORT bool CloseFile(FILE* file);
310 310
311 // Associates a standard FILE stream with an existing File. Note that this
312 // functions take ownership of the existing File.
313 BASE_EXPORT FILE* FileToFILE(File file, const char* mode);
314
311 // Truncates an open file to end at the location of the current file pointer. 315 // Truncates an open file to end at the location of the current file pointer.
312 // This is a cross-platform analog to Windows' SetEndOfFile() function. 316 // This is a cross-platform analog to Windows' SetEndOfFile() function.
313 BASE_EXPORT bool TruncateFile(FILE* file); 317 BASE_EXPORT bool TruncateFile(FILE* file);
314 318
315 // Reads at most the given number of bytes from the file into the buffer. 319 // Reads at most the given number of bytes from the file into the buffer.
316 // Returns the number of read bytes, or -1 on error. 320 // Returns the number of read bytes, or -1 on error.
317 BASE_EXPORT int ReadFile(const FilePath& filename, char* data, int max_size); 321 BASE_EXPORT int ReadFile(const FilePath& filename, char* data, int max_size);
318 322
319 // Writes the given buffer into the file, overwriting any data that was 323 // Writes the given buffer into the file, overwriting any data that was
320 // previously there. Returns the number of bytes written, or -1 on error. 324 // previously there. Returns the number of bytes written, or -1 on error.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 // This function simulates Move(), but unlike Move() it works across volumes. 450 // This function simulates Move(), but unlike Move() it works across volumes.
447 // This function is not transactional. 451 // This function is not transactional.
448 BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path, 452 BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path,
449 const FilePath& to_path); 453 const FilePath& to_path);
450 #endif // defined(OS_WIN) 454 #endif // defined(OS_WIN)
451 455
452 } // namespace internal 456 } // namespace internal
453 } // namespace base 457 } // namespace base
454 458
455 #endif // BASE_FILE_UTIL_H_ 459 #endif // BASE_FILE_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698