create method

Future<Link> create (
  1. String target,
  2. {bool recursive = false}
)

Creates a symbolic link in the file system.

Returns a Future<Link> that completes with the link when it has been created. If the link path already exists, the future will complete with an error.

If recursive is false, the default, the link is created only if all directories in its path exist. If recursive is true, all non-existing parent paths are created first. The directories in the path of target are not affected, unless they are also in path.

On the Windows platform, this call will create a true symbolic link instead of a Junction. In order to create a symbolic link on Windows, Dart must be run in Administrator mode or the system must have Developer Mode enabled, otherwise a FileSystemException will be raised with ERROR_PRIVILEGE_NOT_HELD set as the errno when this call is made.

On other platforms, the POSIX symlink() call is used to make a symbolic link containing the string target. If target is a relative path, it will be interpreted relative to the directory containing the link.

Implementation

Future<Link> create(String target, {bool recursive = false});

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-io/Link/create.html