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

Issue 702363002: Update documentation for RandomAccessFile (Closed)

Created:
6 years, 1 month ago by Søren Gjesse
Modified:
6 years, 1 month ago
CC:
reviews_dartlang.org, kustermann, Bill Hesse
Visibility:
Public.

Description

Update documentation for RandomAccessFile R=kustermann@google.com, lrn@google.com BUG=http://dartbug.com/21516 Committed: https://code.google.com/p/dart/source/detail?r=41548

Patch Set 1 #

Patch Set 2 : Minor fix #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -0 lines) Patch
M sdk/lib/io/file.dart View 1 1 chunk +12 lines, -0 lines 10 comments Download

Messages

Total messages: 6 (1 generated)
Søren Gjesse
6 years, 1 month ago (2014-11-06 07:39:31 UTC) #1
kustermann
LGTM
6 years, 1 month ago (2014-11-06 08:55:13 UTC) #3
Lasse Reichstein Nielsen
https://codereview.chromium.org/702363002/diff/20001/sdk/lib/io/file.dart File sdk/lib/io/file.dart (right): https://codereview.chromium.org/702363002/diff/20001/sdk/lib/io/file.dart#newcode500 sdk/lib/io/file.dart:500: * file. [RandomAccessFile] objects are obtained by calling the ...
6 years, 1 month ago (2014-11-06 09:18:39 UTC) #4
Søren Gjesse
Committed patchset #2 (id:20001) manually as 41548 (presubmit successful).
6 years, 1 month ago (2014-11-06 12:05:39 UTC) #5
Søren Gjesse
6 years, 1 month ago (2014-11-06 12:06:10 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/702363002/diff/20001/sdk/lib/io/file.dart
File sdk/lib/io/file.dart (right):

https://codereview.chromium.org/702363002/diff/20001/sdk/lib/io/file.dart#new...
sdk/lib/io/file.dart:500: * file. [RandomAccessFile] objects are obtained by
calling the
On 2014/11/06 09:18:39, Lasse Reichstein Nielsen wrote:
> New paragraph after "file.".
> 
> Use `RandomAccessFile` instead of [RandomAccessFile] for all but the first
> reference (and maybe even for that, we are already at the [RandomAccessFile]
> declaration, and you should never have a link to where you already are).

Removed all []'s for RandomAccessFile.

https://codereview.chromium.org/702363002/diff/20001/sdk/lib/io/file.dart#new...
sdk/lib/io/file.dart:503: * A [RandomAccessFile] have both asynchronous and
synchronous
On 2014/11/06 09:18:39, Lasse Reichstein Nielsen wrote:
> Swap "synchronous" and "asynchronous". (It sounds a little odd to me this way,
> I'd prefer the "foo" before the "non-foo" in "both foo and non-foo".)

We are "preferring" async over sync, so I think it makes sense to hve async
first.

https://codereview.chromium.org/702363002/diff/20001/sdk/lib/io/file.dart#new...
sdk/lib/io/file.dart:505: * whereas the synchronous methods will block the
current isolate
On 2014/11/06 09:18:39, Lasse Reichstein Nielsen wrote:
> ... will return the result directly, and block the current isolate until the
> result is ready.

Done.

https://codereview.chromium.org/702363002/diff/20001/sdk/lib/io/file.dart#new...
sdk/lib/io/file.dart:510: * already in progress a [FileSystemException] is
thrown.
On 2014/11/06 09:18:39, Lasse Reichstein Nielsen wrote:
> Why the restriction? It would be (much!) better to just not have that
> restriction, even if it would require keeping multiple file descriptors under
> the hood or similar shenanigans.
> 
> Is there any way to detect if a RandomAccessFile is currently performing an
> async operation? If not, consider adding an "isActive" flag (or similar).

If we are to allow several outstanding async operations we are to define the
precise semantics, which would probably be serializing this, as otherwise you
will get undefined behavior.

There is no isActive, and I am not sure we should add that. The user should keep
track of completing futures before calling the next method.

https://codereview.chromium.org/702363002/diff/20001/sdk/lib/io/file.dart#new...
sdk/lib/io/file.dart:513: * synchronous methods. This will also throw a
[FileSystemException].
On 2014/11/06 09:18:39, Lasse Reichstein Nielsen wrote:
> Definitely need a way to see if it's safe.

Again most likely combining async and sync is a programming error. Open one
RandomAccessFile for sync methods and another one for async, and you are good.
We actually thorough about having a sync and a async RandomAccessFile class to
avoid having both sets of methods on the same class.

Powered by Google App Engine
This is Rietveld 408576698