Index: sdk/lib/io/link.dart |
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart |
index 215e22cbd8d6682665536e5e350fc860393bf7b8..bce4bfb5ffdcd21729d13da805606ad6df1a5fde 100644 |
--- a/sdk/lib/io/link.dart |
+++ b/sdk/lib/io/link.dart |
@@ -124,9 +124,16 @@ class _Link extends FileSystemEntity implements Link { |
bool existsSync() => FileSystemEntity.isLinkSync(path); |
Future<Link> create(String target) { |
- // TODO(whesse): Replace with asynchronous version. |
- return new Future.of(() { |
- createSync(target); |
+ _ensureFileService(); |
+ List request = new List(3); |
+ request[0] = _CREATE_LINK_REQUEST; |
+ request[1] = path; |
+ request[2] = target; |
+ return _fileService.call(request).then((response) { |
+ if (_isErrorResponse(response)) { |
+ throw _exceptionFromResponse(response, |
+ "Cannot create link '$path' to target '$target'"); |
+ } |
return this; |
}); |
} |