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

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

Issue 14907009: dart:io | Tiny change to Link.exists(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix static type errors in new test for dartc analyzer. Created 7 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
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 final String path; 121 final String path;
122 122
123 SendPort _fileService; 123 SendPort _fileService;
124 124
125 _Link(String this.path); 125 _Link(String this.path);
126 126
127 _Link.fromPath(Path inputPath) : path = inputPath.toNativePath(); 127 _Link.fromPath(Path inputPath) : path = inputPath.toNativePath();
128 128
129 String toString() => "Link: '$path'"; 129 String toString() => "Link: '$path'";
130 130
131 Future<bool> exists() { 131 Future<bool> exists() => FileSystemEntity.isLink(path);
132 // TODO(whesse): Replace with asynchronous version.
133 return new Future.value(existsSync());
134 }
135 132
136 bool existsSync() => FileSystemEntity.isLinkSync(path); 133 bool existsSync() => FileSystemEntity.isLinkSync(path);
137 134
138 Future<Link> create(String target) { 135 Future<Link> create(String target) {
139 _ensureFileService(); 136 _ensureFileService();
140 if (Platform.operatingSystem == 'windows') { 137 if (Platform.operatingSystem == 'windows') {
141 target = _makeWindowsLinkTarget(target); 138 target = _makeWindowsLinkTarget(target);
142 } 139 }
143 List request = new List(3); 140 List request = new List(3);
144 request[0] = _CREATE_LINK_REQUEST; 141 request[0] = _CREATE_LINK_REQUEST;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 if (path != null) { 272 if (path != null) {
276 sb.write(", path = $path"); 273 sb.write(", path = $path");
277 } 274 }
278 } 275 }
279 return sb.toString(); 276 return sb.toString();
280 } 277 }
281 final String message; 278 final String message;
282 final String path; 279 final String path;
283 final OSError osError; 280 final OSError osError;
284 } 281 }
OLDNEW
« no previous file with comments | « sdk/lib/io/file_system_entity.dart ('k') | tests/standalone/io/file_invalid_arguments_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698