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

Unified Diff: runtime/bin/file.cc

Issue 1193653002: Add file modes for opening a file write only (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Addressed review comments + fixed analyzer reported issues Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file.h ('k') | runtime/bin/file_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.cc
diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
index 15088caab93cf996bae2d9fe8d1e9ee7f7925bf3..59f8300a266fb602b639043a82ebd4f2e0ed2980 100644
--- a/runtime/bin/file.cc
+++ b/runtime/bin/file.cc
@@ -59,13 +59,21 @@ bool File::WriteFully(const void* buffer, int64_t num_bytes) {
File::FileOpenMode File::DartModeToFileMode(DartFileOpenMode mode) {
ASSERT(mode == File::kDartRead ||
mode == File::kDartWrite ||
- mode == File::kDartAppend);
+ mode == File::kDartAppend ||
+ mode == File::kDartWriteOnly ||
+ mode == File::kDartWriteOnlyAppend);
if (mode == File::kDartWrite) {
return File::kWriteTruncate;
}
if (mode == File::kDartAppend) {
return File::kWrite;
}
+ if (mode == File::kDartWriteOnly) {
+ return File::kWriteOnlyTruncate;
+ }
+ if (mode == File::kDartWriteOnlyAppend) {
+ return File::kWriteOnly;
+ }
return File::kRead;
}
« no previous file with comments | « runtime/bin/file.h ('k') | runtime/bin/file_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698