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

Side by Side Diff: runtime/bin/file_impl.dart

Issue 9725001: Reapply part of r5325. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/directory_impl.dart ('k') | runtime/bin/http_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class _FileInputStream extends _BaseDataInputStream implements InputStream { 5 class _FileInputStream extends _BaseDataInputStream implements InputStream {
6 _FileInputStream(String name) { 6 _FileInputStream(String name) {
7 _file = new File(name); 7 _file = new File(name);
8 _data = []; 8 _data = [];
9 _position = 0; 9 _position = 0;
10 _file.onError = (e) { 10 _file.onError = (e) {
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 } 490 }
491 491
492 RandomAccessFile openSync([FileMode mode = FileMode.READ]) { 492 RandomAccessFile openSync([FileMode mode = FileMode.READ]) {
493 if (_asyncUsed) { 493 if (_asyncUsed) {
494 throw new FileIOException( 494 throw new FileIOException(
495 "Mixed use of synchronous and asynchronous API"); 495 "Mixed use of synchronous and asynchronous API");
496 } 496 }
497 if (mode != FileMode.READ && 497 if (mode != FileMode.READ &&
498 mode != FileMode.WRITE && 498 mode != FileMode.WRITE &&
499 mode != FileMode.APPEND) { 499 mode != FileMode.APPEND) {
500 throw new FileIOException("Unknown file mode. Use FileMode.READ, " + 500 throw new FileIOException("Unknown file mode. Use FileMode.READ, "
501 "FileMode.WRITE or FileMode.APPEND."); 501 "FileMode.WRITE or FileMode.APPEND.");
502 } 502 }
503 var id = _FileUtils.checkedOpen(_name, mode._mode); 503 var id = _FileUtils.checkedOpen(_name, mode._mode);
504 assert(id != 0); 504 assert(id != 0);
505 return new _RandomAccessFile(id, _name); 505 return new _RandomAccessFile(id, _name);
506 } 506 }
507 507
508 static RandomAccessFile _openStdioSync(int fd) { 508 static RandomAccessFile _openStdioSync(int fd) {
509 var id = _FileUtils.openStdio(fd); 509 var id = _FileUtils.openStdio(fd);
510 if (id == 0) { 510 if (id == 0) {
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 bool _asyncUsed; 1098 bool _asyncUsed;
1099 int _pendingWrites = 0; 1099 int _pendingWrites = 0;
1100 1100
1101 SendPort _fileService; 1101 SendPort _fileService;
1102 1102
1103 Timer _noPendingWriteTimer; 1103 Timer _noPendingWriteTimer;
1104 1104
1105 Function _onNoPendingWrites; 1105 Function _onNoPendingWrites;
1106 Function _onError; 1106 Function _onError;
1107 } 1107 }
OLDNEW
« no previous file with comments | « runtime/bin/directory_impl.dart ('k') | runtime/bin/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698