Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 | 118 |
| 119 Future<bool> exists() { | 119 Future<bool> exists() { |
| 120 // TODO(whesse): Replace with asynchronous version. | 120 // TODO(whesse): Replace with asynchronous version. |
| 121 return new Future.immediate(existsSync()); | 121 return new Future.immediate(existsSync()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool existsSync() => FileSystemEntity.isLinkSync(path); | 124 bool existsSync() => FileSystemEntity.isLinkSync(path); |
| 125 | 125 |
| 126 Future<Link> create(String target) { | 126 Future<Link> create(String target) { |
| 127 _ensureFileService(); | 127 _ensureFileService(); |
| 128 if (Platform.operatingSystem == 'windows') { | |
|
Bill Hesse
2013/04/08 15:46:01
Copied from lines 145-147.
| |
| 129 target = _makeWindowsLinkTarget(target); | |
| 130 } | |
| 128 List request = new List(3); | 131 List request = new List(3); |
| 129 request[0] = _CREATE_LINK_REQUEST; | 132 request[0] = _CREATE_LINK_REQUEST; |
| 130 request[1] = path; | 133 request[1] = path; |
| 131 request[2] = target; | 134 request[2] = target; |
| 132 return _fileService.call(request).then((response) { | 135 return _fileService.call(request).then((response) { |
| 133 if (_isErrorResponse(response)) { | 136 if (_isErrorResponse(response)) { |
| 134 throw _exceptionFromResponse(response, | 137 throw _exceptionFromResponse(response, |
| 135 "Cannot create link '$path' to target '$target'"); | 138 "Cannot create link '$path' to target '$target'"); |
| 136 } | 139 } |
| 137 return this; | 140 return this; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 if (path != null) { | 256 if (path != null) { |
| 254 sb.write(", path = $path"); | 257 sb.write(", path = $path"); |
| 255 } | 258 } |
| 256 } | 259 } |
| 257 return sb.toString(); | 260 return sb.toString(); |
| 258 } | 261 } |
| 259 final String message; | 262 final String message; |
| 260 final String path; | 263 final String path; |
| 261 final OSError osError; | 264 final OSError osError; |
| 262 } | 265 } |
| OLD | NEW |