| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 170 } |
| 171 | 171 |
| 172 // Put target into the form "\??\C:\my\target\dir". | 172 // Put target into the form "\??\C:\my\target\dir". |
| 173 String _makeWindowsLinkTarget(String target) { | 173 String _makeWindowsLinkTarget(String target) { |
| 174 if (target.startsWith('\\??\\')) { | 174 if (target.startsWith('\\??\\')) { |
| 175 return target; | 175 return target; |
| 176 } | 176 } |
| 177 if (!(target.length > 3 && target[1] == ':' && target[2] == '\\')) { | 177 if (!(target.length > 3 && target[1] == ':' && target[2] == '\\')) { |
| 178 try { | 178 try { |
| 179 target = new File(target).fullPathSync(); | 179 target = new File(target).fullPathSync(); |
| 180 } catch (e) { | 180 } on FileException catch (e) { |
| 181 throw new LinkException('Could not locate target', target, e.osError); | 181 throw new LinkException('Could not locate target', target, e.osError); |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 if (target.length > 3 && target[1] == ':' && target[2] == '\\') { | 184 if (target.length > 3 && target[1] == ':' && target[2] == '\\') { |
| 185 target = '\\??\\$target'; | 185 target = '\\??\\$target'; |
| 186 } else { | 186 } else { |
| 187 throw new LinkException( | 187 throw new LinkException( |
| 188 'Target $target of Link.create on Windows cannot be converted' + | 188 'Target $target of Link.create on Windows cannot be converted' + |
| 189 ' to start with a drive letter. Unexpected error.'); | 189 ' to start with a drive letter. Unexpected error.'); |
| 190 } | 190 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 if (path != null) { | 308 if (path != null) { |
| 309 sb.write(", path = $path"); | 309 sb.write(", path = $path"); |
| 310 } | 310 } |
| 311 } | 311 } |
| 312 return sb.toString(); | 312 return sb.toString(); |
| 313 } | 313 } |
| 314 final String message; | 314 final String message; |
| 315 final String path; | 315 final String path; |
| 316 final OSError osError; | 316 final OSError osError; |
| 317 } | 317 } |
| OLD | NEW |