Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * The modes in which a File can be opened. | 8 * The modes in which a File can be opened. |
| 9 */ | 9 */ |
| 10 class FileMode { | 10 class FileMode { |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 490 | 490 |
| 491 /** | 491 /** |
| 492 * Get the path of the file. | 492 * Get the path of the file. |
| 493 */ | 493 */ |
| 494 String get path; | 494 String get path; |
| 495 } | 495 } |
| 496 | 496 |
| 497 | 497 |
| 498 /** | 498 /** |
| 499 * [RandomAccessFile] provides random access to the data in a | 499 * [RandomAccessFile] provides random access to the data in a |
| 500 * file. [RandomAccessFile] objects are obtained by calling the | 500 * file. [RandomAccessFile] objects are obtained by calling the |
|
Lasse Reichstein Nielsen
2014/11/06 09:18:39
New paragraph after "file.".
Use `RandomAccessFil
Søren Gjesse
2014/11/06 12:06:10
Removed all []'s for RandomAccessFile.
| |
| 501 * [:open:] method on a [File] object. | 501 * [:open:] method on a [File] object. |
| 502 * | |
| 503 * A [RandomAccessFile] have both asynchronous and synchronous | |
|
Lasse Reichstein Nielsen
2014/11/06 09:18:39
Swap "synchronous" and "asynchronous". (It sounds
Søren Gjesse
2014/11/06 12:06:10
We are "preferring" async over sync, so I think it
| |
| 504 * methods. The asynchronous methods all return a `Future` | |
| 505 * whereas the synchronous methods will block the current isolate | |
|
Lasse Reichstein Nielsen
2014/11/06 09:18:39
... will return the result directly, and block the
Søren Gjesse
2014/11/06 12:06:10
Done.
| |
| 506 * and return the result directly. | |
| 507 * | |
| 508 * At most one asynchronous method can be pending on a given [RandomAccessFile] | |
| 509 * instance at the time. If an asynchronous method is called when one is | |
| 510 * already in progress a [FileSystemException] is thrown. | |
|
Lasse Reichstein Nielsen
2014/11/06 09:18:39
Why the restriction? It would be (much!) better to
Søren Gjesse
2014/11/06 12:06:10
If we are to allow several outstanding async opera
| |
| 511 * | |
| 512 * If an asynchronous method is pending it is also not possible to call any | |
| 513 * synchronous methods. This will also throw a [FileSystemException]. | |
|
Lasse Reichstein Nielsen
2014/11/06 09:18:39
Definitely need a way to see if it's safe.
Søren Gjesse
2014/11/06 12:06:10
Again most likely combining async and sync is a pr
| |
| 502 */ | 514 */ |
| 503 abstract class RandomAccessFile { | 515 abstract class RandomAccessFile { |
| 504 /** | 516 /** |
| 505 * Closes the file. Returns a [:Future<RandomAccessFile>:] that | 517 * Closes the file. Returns a [:Future<RandomAccessFile>:] that |
| 506 * completes with this RandomAccessFile when it has been closed. | 518 * completes with this RandomAccessFile when it has been closed. |
| 507 */ | 519 */ |
| 508 Future<RandomAccessFile> close(); | 520 Future<RandomAccessFile> close(); |
| 509 | 521 |
| 510 /** | 522 /** |
| 511 * Synchronously closes the file. | 523 * Synchronously closes the file. |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 740 sb.write(": $osError"); | 752 sb.write(": $osError"); |
| 741 if (path != null) { | 753 if (path != null) { |
| 742 sb.write(", path = '$path'"); | 754 sb.write(", path = '$path'"); |
| 743 } | 755 } |
| 744 } else if (path != null) { | 756 } else if (path != null) { |
| 745 sb.write(": $path"); | 757 sb.write(": $path"); |
| 746 } | 758 } |
| 747 return sb.toString(); | 759 return sb.toString(); |
| 748 } | 760 } |
| 749 } | 761 } |
| OLD | NEW |