Directory class abstract

A reference to a directory on the file system.

Inheritance
Implemented types
Implementers
Available extensions

Constructors

Directory(String path)
Creates a Directory object.
factory

Properties

absolute Directory
Returns a Directory instance whose path is the absolute path to this.
no setter
fs FileSystem
The file system for this entity.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isAbsolute bool
Returns a bool indicating whether this object's path is absolute.
no setterinherited
parent Directory
The directory containing this.
no setterinherited
path String
The path of the entity.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

childPath(String path) String
Child path
inherited
create({bool recursive = false}) Future<Directory>
Creates the directory with this name.
delete({bool recursive = false}) Future<FileSystemEntity>
Deletes this FileSystemEntity.
inherited
directory(String path) Directory
Child directory
inherited
directoryWith({String? path}) Directory
Directory from an optional path, null meaning itself for Directory, currentDirectory for FileSystem
inherited
emptyOrCreate() Future<void>

Available on Directory, provided by the DirectoryEmptyOrCreateExt extension

Ensure the directory is created and empty.
exists() Future<bool>
Checks whether the file system entity with this path exists.
inherited
file(String path) File
Child file
inherited
Child link
inherited
list({bool recursive = false, bool followLinks = true}) Stream<FileSystemEntity>
Lists the sub-directories and files of this Directory.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rename(String newPath) Future<FileSystemEntity>
Renames this file system entity.
inherited
stat() Future<FileStat>
Calls the operating system's stat() function on the path of this FileSystemEntity.
inherited
toString() String
A string representation of this object.
inherited
tryCreate() Future<bool>

Available on Directory, provided by the FsShimDirectoryExtension extension

Tries to create a directory at path. Never throws.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

current Directory
A Directory object pointing to the current working directory.
no setter