Use the Link target() method to get the path that the link points to.
import 'dart:async'; import 'dart:io'; // Creates temporary directory inside the system temp directory, creates a // couple of paths in the created directory, and creates a symlink. Future<Link> createSymLink() async { var temp = await Directory.systemTemp.createTemp('my_temp_dir'); var first = '${temp.path}${Platform.pathSeparator}first'; var second = '${temp.path}${Platform.pathSeparator}second'; return new Link(second).create(first); } main() async { try { var link = await createSymLink(); print(link.path); var targetPath = await link.target(); print(targetPath); } catch (e) { print(e.message); } }
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did129493