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

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

Issue 12638039: dart:io | Add "followLinks" optional parameter to Directory.list, let it return Link objects when f… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove stray changes from directory_test. Created 7 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
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 /** 7 /**
8 * [Link] objects are references to filesystem links. 8 * [Link] objects are references to filesystem links.
9 * 9 *
10 */ 10 */
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 106
107 107
108 class _Link extends FileSystemEntity implements Link { 108 class _Link extends FileSystemEntity implements Link {
109 final String path; 109 final String path;
110 110
111 _Link(String this.path); 111 _Link(String this.path);
112 112
113 _Link.fromPath(Path inputPath) : path = inputPath.toNativePath(); 113 _Link.fromPath(Path inputPath) : path = inputPath.toNativePath();
114 114
115 String toString() => "Link: '$path'";
116
115 Future<bool> exists() { 117 Future<bool> exists() {
116 // TODO(whesse): Replace with asynchronous version. 118 // TODO(whesse): Replace with asynchronous version.
117 return new Future.immediate(existsSync()); 119 return new Future.immediate(existsSync());
118 } 120 }
119 121
120 bool existsSync() => FileSystemEntity.isLinkSync(path); 122 bool existsSync() => FileSystemEntity.isLinkSync(path);
121 123
122 Future<Link> create(String target) { 124 Future<Link> create(String target) {
123 // TODO(whesse): Replace with asynchronous version. 125 // TODO(whesse): Replace with asynchronous version.
124 return new Future.of(() { 126 return new Future.of(() {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 if (path != null) { 206 if (path != null) {
205 sb.write(", path = $path"); 207 sb.write(", path = $path");
206 } 208 }
207 } 209 }
208 return sb.toString(); 210 return sb.toString();
209 } 211 }
210 final String message; 212 final String message;
211 final String path; 213 final String path;
212 final OSError osError; 214 final OSError osError;
213 } 215 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698