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

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

Issue 2681683005: [dart:io] Adds functions to set file access and modification time (Closed)
Patch Set: Update changelog Created 3 years, 10 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
« no previous file with comments | « sdk/lib/io/io_service.dart ('k') | tests/standalone/io/file_test.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 /** 7 /**
8 * [Link] objects are references to filesystem links. 8 * [Link] objects are references to filesystem links.
9 * 9 *
10 */ 10 */
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 156
157 String toString() => "Link: '$path'"; 157 String toString() => "Link: '$path'";
158 158
159 Future<bool> exists() => FileSystemEntity.isLink(path); 159 Future<bool> exists() => FileSystemEntity.isLink(path);
160 160
161 bool existsSync() => FileSystemEntity.isLinkSync(path); 161 bool existsSync() => FileSystemEntity.isLinkSync(path);
162 162
163 Link get absolute => new Link(_absolutePath); 163 Link get absolute => new Link(_absolutePath);
164 164
165 Future<FileStat> stat() => FileStat.stat(path);
166
167 FileStat statSync() => FileStat.statSync(path);
168
169 Future<Link> create(String target, {bool recursive: false}) { 165 Future<Link> create(String target, {bool recursive: false}) {
170 if (Platform.isWindows) { 166 if (Platform.isWindows) {
171 target = _makeWindowsLinkTarget(target); 167 target = _makeWindowsLinkTarget(target);
172 } 168 }
173 var result = recursive ? parent.create(recursive: true) 169 var result = recursive ? parent.create(recursive: true)
174 : new Future.value(null); 170 : new Future.value(null);
175 return result 171 return result
176 .then((_) => _IOService._dispatch(_FILE_CREATE_LINK, [path, target])) 172 .then((_) => _IOService._dispatch(_FILE_CREATE_LINK, [path, target]))
177 .then((response) { 173 .then((response) {
178 if (_isErrorResponse(response)) { 174 if (_isErrorResponse(response)) {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 return new ArgumentError(); 292 return new ArgumentError();
297 case _OSERROR_RESPONSE: 293 case _OSERROR_RESPONSE:
298 var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE], 294 var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE],
299 response[_OSERROR_RESPONSE_ERROR_CODE]); 295 response[_OSERROR_RESPONSE_ERROR_CODE]);
300 return new FileSystemException(message, path, err); 296 return new FileSystemException(message, path, err);
301 default: 297 default:
302 return new Exception("Unknown error"); 298 return new Exception("Unknown error");
303 } 299 }
304 } 300 }
305 } 301 }
OLDNEW
« no previous file with comments | « sdk/lib/io/io_service.dart ('k') | tests/standalone/io/file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698