Link objects are references to filesystem links.
- Implements
Properties
- Link absolute
-
read-onlyReturns a
Link
instance whose path is the absolute path tothis
. - bool isAbsolute
-
read-only, inheritedReturns a
bool
indicating whether this object's path is absolute. - Directory parent
-
read-only, inheritedThe directory containing
this
. Ifthis
is a root directory, returnsthis
. - String path
-
read-only, inherited
- Uri uri
-
read-only, inheritedReturns a
Uri
representing the file system entity's location.
Constructors
- Link(String path)
- Creates a Link object.
- Link.fromUri(Uri uri)
- Creates a Link object.
Methods
-
create(
String target, {bool recursive: false}) → Future<Link> -
Creates a symbolic link. Returns a
Future<Link>
that completes with the link when it has been created. If the link exists, the future will complete with an error. -
createSync(
String target, {bool recursive: false}) → void - Synchronously create the link. Calling createSync on an existing link will throw an exception.
-
delete(
{bool recursive: false}) → Future<FileSystemEntity> -
inheritedDeletes this FileSystemEntity.
-
deleteSync(
{bool recursive: false}) → void -
inheritedSynchronously deletes this FileSystemEntity.
-
exists(
) → Future<bool> -
inheritedChecks whether the file system entity with this path exists. Returns a
Future<bool>
that completes with the result. -
existsSync(
) → bool -
inheritedSynchronously checks whether the file system entity with this path exists.
-
rename(
String newPath) → Future<Link> -
Renames this link. Returns a
Future<Link>
that completes with a Link instance for the renamed link. -
renameSync(
String newPath) → Link - Synchronously renames this link. Returns a Link instance for the renamed link.
-
resolveSymbolicLinks(
) → Future<String> -
Resolves the path of a file system object relative to the
current working directory, resolving all symbolic links on
the path and resolving all
..
and.
path segments. -
resolveSymbolicLinksSync(
) → String -
Resolves the path of a file system object relative to the
current working directory, resolving all symbolic links on
the path and resolving all
..
and.
path segments. -
stat(
) → Future<FileStat> -
inheritedCalls the operating system's stat() function on the path of this FileSystemEntity. Identical to
FileStat.stat(this.path)
. -
statSync(
) → FileStat -
inheritedSynchronously calls the operating system's stat() function on the path of this FileSystemEntity. Identical to
FileStat.statSync(this.path)
. -
target(
) → Future<String> - Gets the target of the link. Returns a future that completes with the path to the target.
-
targetSync(
) → String - Synchronously gets the target of the link. Returns the path to the target.
-
update(
String target) → Future<Link> -
Updates the link. Returns a
Future<Link>
that completes with the link when it has been updated. Calling update on a non-existing link will complete its returned future with an exception. -
updateSync(
String target) → void - Synchronously updates the link. Calling updateSync on a non-existing link will throw an exception.
-
watch(
{int events: FileSystemEvent.ALL, bool recursive: false}) → Stream<FileSystemEvent> -
inheritedStart watching the FileSystemEntity for changes.