| Index: sdk/lib/io/link.dart
|
| diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart
|
| index fee4f97fc6271aef7a1e7862dc1eab7ce2af1d10..ad3e6603969ad2676d365a82e7338cb6a67e3894 100644
|
| --- a/sdk/lib/io/link.dart
|
| +++ b/sdk/lib/io/link.dart
|
| @@ -164,11 +164,21 @@ class _Link extends FileSystemEntity implements Link {
|
| }
|
|
|
| Future<Link> delete() {
|
| - return new File(path).delete().then((_) => this);
|
| + _ensureFileService();
|
| + List request = new List(2);
|
| + request[0] = _LINK_DELETE_REQUEST;
|
| + request[1] = path;
|
| + return _fileService.call(request).then((response) {
|
| + if (_isErrorResponse(response)) {
|
| + throw _exceptionFromResponse(response, "Cannot delete file '$path'");
|
| + }
|
| + return this;
|
| + });
|
| }
|
|
|
| void deleteSync() {
|
| - new File(path).deleteSync();
|
| + var result = _File._deleteLink(path);
|
| + throwIfError(result, "Cannot delete file '$path'");
|
| }
|
|
|
| Future<String> target() {
|
| @@ -183,6 +193,12 @@ class _Link extends FileSystemEntity implements Link {
|
| }
|
| return result;
|
| }
|
| +
|
| + static throwIfError(Object result, String msg) {
|
| + if (result is OSError) {
|
| + throw new FileIOException(msg, result);
|
| + }
|
| + }
|
| }
|
|
|
|
|
|
|