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

Side by Side Diff: sdk/lib/io/file_impl.dart

Issue 22893005: Fix some analyzer warnings in dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | « sdk/lib/io/directory_impl.dart ('k') | sdk/lib/io/http.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) 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 // Read the file in blocks of size 64k. 7 // Read the file in blocks of size 64k.
8 const int _BLOCK_SIZE = 64 * 1024; 8 const int _BLOCK_SIZE = 64 * 1024;
9 9
10 10
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 339
340 external static _renameLink(String oldPath, String newPath); 340 external static _renameLink(String oldPath, String newPath);
341 341
342 File renameSync(String newPath) { 342 File renameSync(String newPath) {
343 var result = _rename(path, newPath); 343 var result = _rename(path, newPath);
344 throwIfError(result, "Cannot rename file to '$newPath'", path); 344 throwIfError(result, "Cannot rename file to '$newPath'", path);
345 return new File(newPath); 345 return new File(newPath);
346 } 346 }
347 347
348 Directory get directory { 348 Directory get directory {
349 Path path = new Path(path).directoryPath; 349 Path path = new Path(this.path).directoryPath;
350 return new Directory.fromPath(path); 350 return new Directory.fromPath(path);
351 } 351 }
352 352
353 Future<RandomAccessFile> open({FileMode mode: FileMode.READ}) { 353 Future<RandomAccessFile> open({FileMode mode: FileMode.READ}) {
354 _ensureFileService(); 354 _ensureFileService();
355 if (mode != FileMode.READ && 355 if (mode != FileMode.READ &&
356 mode != FileMode.WRITE && 356 mode != FileMode.WRITE &&
357 mode != FileMode.APPEND) { 357 mode != FileMode.APPEND) {
358 return new Future.error(new ArgumentError()); 358 return new Future.error(new ArgumentError());
359 } 359 }
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 void _checkNotClosed() { 980 void _checkNotClosed() {
981 if (closed) { 981 if (closed) {
982 throw new FileException("File closed", path); 982 throw new FileException("File closed", path);
983 } 983 }
984 } 984 }
985 985
986 Future _closedException() { 986 Future _closedException() {
987 return new Future.error(new FileException("File closed", path)); 987 return new Future.error(new FileException("File closed", path));
988 } 988 }
989 } 989 }
OLDNEW
« no previous file with comments | « sdk/lib/io/directory_impl.dart ('k') | sdk/lib/io/http.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698