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

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

Issue 23468027: Add FileSystemEntity.absolutePath and .isAbsolute properties. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Change name to absolute, return type to File, Directory, and Link. Created 7 years, 3 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/file.dart ('k') | sdk/lib/io/file_system_entity.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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 } 260 }
261 261
262 external static _exists(String path); 262 external static _exists(String path);
263 263
264 bool existsSync() { 264 bool existsSync() {
265 var result = _exists(path); 265 var result = _exists(path);
266 throwIfError(result, "Cannot check existence of file", path); 266 throwIfError(result, "Cannot check existence of file", path);
267 return result; 267 return result;
268 } 268 }
269 269
270 File get absolute => new File(_absolutePath);
271
270 Future<FileStat> stat() => FileStat.stat(path); 272 Future<FileStat> stat() => FileStat.stat(path);
271 273
272 FileStat statSync() => FileStat.statSync(path); 274 FileStat statSync() => FileStat.statSync(path);
273 275
274 Future<File> create() { 276 Future<File> create() {
275 _ensureFileService(); 277 _ensureFileService();
276 List request = new List(2); 278 List request = new List(2);
277 request[0] = _CREATE_REQUEST; 279 request[0] = _CREATE_REQUEST;
278 request[1] = path; 280 request[1] = path;
279 return _fileService.call(request).then((response) { 281 return _fileService.call(request).then((response) {
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 void _checkNotClosed() { 999 void _checkNotClosed() {
998 if (closed) { 1000 if (closed) {
999 throw new FileException("File closed", path); 1001 throw new FileException("File closed", path);
1000 } 1002 }
1001 } 1003 }
1002 1004
1003 Future _closedException() { 1005 Future _closedException() {
1004 return new Future.error(new FileException("File closed", path)); 1006 return new Future.error(new FileException("File closed", path));
1005 } 1007 }
1006 } 1008 }
OLDNEW
« no previous file with comments | « sdk/lib/io/file.dart ('k') | sdk/lib/io/file_system_entity.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698