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

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

Issue 52263003: Implement least upper bound. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years 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/_internal/compiler/implementation/warnings.dart ('k') | sdk/lib/io/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) 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 return result; 250 return result;
251 } 251 }
252 252
253 File get absolute => new File(_absolutePath); 253 File get absolute => new File(_absolutePath);
254 254
255 Future<FileStat> stat() => FileStat.stat(path); 255 Future<FileStat> stat() => FileStat.stat(path);
256 256
257 FileStat statSync() => FileStat.statSync(path); 257 FileStat statSync() => FileStat.statSync(path);
258 258
259 Future<File> create({bool recursive: false}) { 259 Future<File> create({bool recursive: false}) {
260 return (recursive ? parent.create(recursive: true) 260 var result = recursive ? parent.create(recursive: true)
261 : new Future.value(null)) 261 : new Future.value(null);
262 return result
262 .then((_) => _IOService.dispatch(_FILE_CREATE, [path])) 263 .then((_) => _IOService.dispatch(_FILE_CREATE, [path]))
263 .then((response) { 264 .then((response) {
264 if (_isErrorResponse(response)) { 265 if (_isErrorResponse(response)) {
265 throw _exceptionFromResponse(response, "Cannot create file", path); 266 throw _exceptionFromResponse(response, "Cannot create file", path);
266 } 267 }
267 return this; 268 return this;
268 }); 269 });
269 } 270 }
270 271
271 external static _create(String path); 272 external static _create(String path);
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 890
890 void _checkAvailable() { 891 void _checkAvailable() {
891 if (_asyncDispatched) { 892 if (_asyncDispatched) {
892 throw new FileSystemException("An async operation is currently pending", p ath); 893 throw new FileSystemException("An async operation is currently pending", p ath);
893 } 894 }
894 if (closed) { 895 if (closed) {
895 throw new FileSystemException("File closed", path); 896 throw new FileSystemException("File closed", path);
896 } 897 }
897 } 898 }
898 } 899 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/warnings.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698