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

Issue 8399033: First round of changes to the file interface. (Closed)

Created:
9 years, 1 month ago by Mads Ager (google)
Modified:
9 years, 1 month ago
Reviewers:
Søren Gjesse
CC:
reviews_dartlang.org, Ivan Posva, jimhug
Visibility:
Public.

Description

First round of changes to the file interface. Have both async and sync version for the file operations. The thinking is that once you have used an async operation you will not be allowed to use a sync one. Only sync versions currently implemented. Instead of having one input and one output stream associated with a file we create new streams whenever needed. These get their own underlying file descriptor so they do not interfere. This means that FileStreams have to be explicitly closed. R=sgjesse@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=819

Patch Set 1 #

Total comments: 10

Patch Set 2 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+440 lines, -210 lines) Patch
M runtime/bin/builtin_in.cc View 2 chunks +2 lines, -10 lines 0 comments Download
M runtime/bin/file.cc View 1 6 chunks +8 lines, -15 lines 0 comments Download
M runtime/bin/file.dart View 1 1 chunk +174 lines, -34 lines 0 comments Download
M runtime/bin/file_impl.dart View 7 chunks +164 lines, -60 lines 0 comments Download
M runtime/bin/socket.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/bin/socket_impl.dart View 1 chunk +1 line, -4 lines 0 comments Download
M samples/chat/chat_server_lib.dart View 3 chunks +7 lines, -6 lines 0 comments Download
M tests/standalone/src/FileInputStreamTest.dart View 1 chunk +5 lines, -4 lines 0 comments Download
M tests/standalone/src/FileTest.dart View 22 chunks +76 lines, -74 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mads Ager (google)
9 years, 1 month ago (2011-10-27 12:52:03 UTC) #1
Søren Gjesse
lgtm http://codereview.chromium.org/8399033/diff/1/runtime/bin/file.dart File runtime/bin/file.dart (right): http://codereview.chromium.org/8399033/diff/1/runtime/bin/file.dart#newcode39 runtime/bin/file.dart:39: void open([bool writable]); [bool writable] -> [bool writable ...
9 years, 1 month ago (2011-10-27 13:07:50 UTC) #2
Mads Ager (google)
9 years, 1 month ago (2011-10-27 13:21:46 UTC) #3
http://codereview.chromium.org/8399033/diff/1/runtime/bin/file.dart
File runtime/bin/file.dart (right):

http://codereview.chromium.org/8399033/diff/1/runtime/bin/file.dart#newcode39
runtime/bin/file.dart:39: void open([bool writable]);
On 2011/10/27 13:07:50, Søren Gjesse wrote:
> [bool writable] -> [bool writable = false]

You can only supply the default when you implement it.

http://codereview.chromium.org/8399033/diff/1/runtime/bin/file.dart#newcode46
runtime/bin/file.dart:46: void openSync([bool writable]);
On 2011/10/27 13:07:50, Søren Gjesse wrote:
> Ditto.

Same, can only supply the default value when you implement it.

http://codereview.chromium.org/8399033/diff/1/runtime/bin/file.dart#newcode104
runtime/bin/file.dart:104: * Synchronously write a List<int> to the file. If the
list cannot be
On 2011/10/27 13:07:50, Søren Gjesse wrote:
> Replace "If the list..." with !Returns true if the list was successfully
written
> and false otherwise."

Thanks! Done.

http://codereview.chromium.org/8399033/diff/1/runtime/bin/file.dart#newcode115
runtime/bin/file.dart:115: void writeString(String string);
On 2011/10/27 13:07:50, Søren Gjesse wrote:
> Shouldn't this have an encoding?

Yes, it should. I'll add a TODO and address it in a separate changelist.

http://codereview.chromium.org/8399033/diff/1/runtime/bin/file.dart#newcode121
runtime/bin/file.dart:121: bool writeStringSync(String string);
On 2011/10/27 13:07:50, Søren Gjesse wrote:
> Ditto.

Yes, I'll add a TODO.

Powered by Google App Engine
This is Rietveld 408576698