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

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

Issue 10361003: Fix inconsistent file error messages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 | « no previous file | no next file » | 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 var file = new File(name); 7 var file = new File(name);
8 _data = []; 8 _data = [];
9 _position = 0; 9 _position = 0;
10 file.onError = _reportError; 10 file.onError = _reportError;
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 // Constructor for file. 412 // Constructor for file.
413 _File(String this._name); 413 _File(String this._name);
414 414
415 void exists(void callback(bool exists)) { 415 void exists(void callback(bool exists)) {
416 _ensureFileService(); 416 _ensureFileService();
417 List request = new List(2); 417 List request = new List(2);
418 request[0] = _FileUtils.kExistsRequest; 418 request[0] = _FileUtils.kExistsRequest;
419 request[1] = _name; 419 request[1] = _name;
420 _fileService.call(request).then((response) { 420 _fileService.call(request).then((response) {
421 if (_isErrorResponse(response)) { 421 if (_isErrorResponse(response)) {
422 _handleErrorResponse(response, "Cannot open file $_name"); 422 _handleErrorResponse(response, "Cannot open file '$_name'");
423 } else { 423 } else {
424 callback(response); 424 callback(response);
425 } 425 }
426 }); 426 });
427 } 427 }
428 428
429 bool existsSync() { 429 bool existsSync() {
430 return _FileUtils.checkedExists(_name); 430 return _FileUtils.checkedExists(_name);
431 } 431 }
432 432
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 mode != FileMode.APPEND) { 495 mode != FileMode.APPEND) {
496 _reportError(new IllegalArgumentException()); 496 _reportError(new IllegalArgumentException());
497 return; 497 return;
498 } 498 }
499 List request = new List(3); 499 List request = new List(3);
500 request[0] = _FileUtils.kOpenRequest; 500 request[0] = _FileUtils.kOpenRequest;
501 request[1] = _name; 501 request[1] = _name;
502 request[2] = mode._mode; // Direct int value for serialization. 502 request[2] = mode._mode; // Direct int value for serialization.
503 _fileService.call(request).then((response) { 503 _fileService.call(request).then((response) {
504 if (_isErrorResponse(response)) { 504 if (_isErrorResponse(response)) {
505 _handleErrorResponse(response, "Cannot open file $_name"); 505 _handleErrorResponse(response, "Cannot open file '$_name'");
506 } else { 506 } else {
507 callback(new _RandomAccessFile(response, _name)); 507 callback(new _RandomAccessFile(response, _name));
508 } 508 }
509 }); 509 });
510 } 510 }
511 511
512 void length(void callback(int length)) { 512 void length(void callback(int length)) {
513 _ensureFileService(); 513 _ensureFileService();
514 List request = new List(2); 514 List request = new List(2);
515 request[0] = _FileUtils.kLengthFromNameRequest; 515 request[0] = _FileUtils.kLengthFromNameRequest;
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 String _name; 1042 String _name;
1043 int _id; 1043 int _id;
1044 int _pendingWrites = 0; 1044 int _pendingWrites = 0;
1045 1045
1046 SendPort _fileService; 1046 SendPort _fileService;
1047 1047
1048 Timer _noPendingWriteTimer; 1048 Timer _noPendingWriteTimer;
1049 1049
1050 Function _onNoPendingWrites; 1050 Function _onNoPendingWrites;
1051 } 1051 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698