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

Side by Side Diff: base/file_util.h

Issue 1681: Make CreateDirectory consistent on Win and Posix when directory exists. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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_win.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) 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 // TODO(erikkay): rename this function and track down all of the callers. 215 // TODO(erikkay): rename this function and track down all of the callers.
216 bool CreateTemporaryFileName(std::wstring* temp_file); 216 bool CreateTemporaryFileName(std::wstring* temp_file);
217 217
218 // Create a new directory under TempPath. If prefix is provided, the new 218 // Create a new directory under TempPath. If prefix is provided, the new
219 // directory name is in the format of prefixyyyy. 219 // directory name is in the format of prefixyyyy.
220 // If success, return true and output the full path of the directory created. 220 // If success, return true and output the full path of the directory created.
221 bool CreateNewTempDirectory(const std::wstring& prefix, 221 bool CreateNewTempDirectory(const std::wstring& prefix,
222 std::wstring* new_temp_path); 222 std::wstring* new_temp_path);
223 223
224 // Creates a directory, as well as creating any parent directories, if they 224 // Creates a directory, as well as creating any parent directories, if they
225 // don't exist. Returns 'true' on successful creation. 225 // don't exist. Returns 'true' on successful creation, or if the directory
226 // already exists.
226 bool CreateDirectory(const std::wstring& full_path); 227 bool CreateDirectory(const std::wstring& full_path);
227 228
228 // Returns the file size. Returns true on success. 229 // Returns the file size. Returns true on success.
229 bool GetFileSize(const std::wstring& file_path, int64* file_size); 230 bool GetFileSize(const std::wstring& file_path, int64* file_size);
230 231
231 // Reads the given number of bytes from the file into the buffer. Returns 232 // Reads the given number of bytes from the file into the buffer. Returns
232 // the number of read bytes, or -1 on error. 233 // the number of read bytes, or -1 on error.
233 int ReadFile(const std::wstring& filename, char* data, int size); 234 int ReadFile(const std::wstring& filename, char* data, int size);
234 235
235 // Writes the given buffer into the file, overwriting any data that was 236 // Writes the given buffer into the file, overwriting any data that was
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 314
314 // Renames a file using the MoveFileEx API and ensures that the target file gets 315 // Renames a file using the MoveFileEx API and ensures that the target file gets
315 // the correct security descriptor in the new path. 316 // the correct security descriptor in the new path.
316 bool RenameFileAndResetSecurityDescriptor( 317 bool RenameFileAndResetSecurityDescriptor(
317 const std::wstring& source_file_path, 318 const std::wstring& source_file_path,
318 const std::wstring& target_file_path); 319 const std::wstring& target_file_path);
319 320
320 } // namespace file_util 321 } // namespace file_util
321 322
322 #endif // BASE_FILE_UTIL_H_ 323 #endif // BASE_FILE_UTIL_H_
323
OLDNEW
« no previous file with comments | « no previous file | base/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698