Chromium Code Reviews| Index: base/files/file_util.h |
| diff --git a/base/files/file_util.h b/base/files/file_util.h |
| index ecc0d581dab8a29f70d6d1463c6aacd6d45b3e9a..f274f5bbd72b6dc17ead7ae112511819bb729f34 100644 |
| --- a/base/files/file_util.h |
| +++ b/base/files/file_util.h |
| @@ -321,7 +321,9 @@ BASE_EXPORT bool TruncateFile(FILE* file); |
| BASE_EXPORT int ReadFile(const FilePath& filename, char* data, int max_size); |
| // Writes the given buffer into the file, overwriting any data that was |
| -// previously there. Returns the number of bytes written, or -1 on error. |
| +// previously there. Returns the number of bytes written, or -1 on error. |
| +// The file will be created with a default mode (POSIX) or security |
| +// descriptor (Windows). To specify a mode on POSIX, use |WriteFileMode|. |
| BASE_EXPORT int WriteFile(const FilePath& filename, const char* data, |
| int size); |
| @@ -329,6 +331,12 @@ BASE_EXPORT int WriteFile(const FilePath& filename, const char* data, |
| // Appends |data| to |fd|. Does not close |fd| when done. Returns true iff |
| // |size| bytes of |data| were written to |fd|. |
| BASE_EXPORT bool WriteFileDescriptor(const int fd, const char* data, int size); |
| + |
| +// Writes the given buffer into the file, overwriting any data that was |
| +// previously there. Returns the number of bytes written, or -1 on error. |
| +// The file is created with the given |mode|. |
| +BASE_EXPORT int WriteFileMode(const FilePath& filename, const char* data, |
|
rvargas (doing something else)
2014/10/17 22:28:58
This function should return bool. See crbug.com/41
palmer
2014/10/17 22:52:37
Done.
|
| + int size, mode_t mode); |
| #endif |
| // Appends |data| to |filename|. Returns true iff |size| bytes of |data| were |