Fs class
static methods for filesystem manipulation operations.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
canonicalize(
Path path) → Path -
copy(
Path from, Path to) → FutureResult< (), IoError> - Copies this file.
-
copySync(
Path from, Path to) → Result< (), IoError> - Copies this file.
-
createDir(
Path path) → FutureResult< (), IoError> - Creates the directory if it doesn't exist. Does not create intermediate directories if they do not exist - see Fs.createDirAll.
-
createDirAll(
Path path) → FutureResult< (), IoError> - Creates the directory if it doesn't exist. Will create all non-existing path components.
-
createDirAllSync(
Path path) → Result< (), IoError> - Creates the directory if it doesn't exist. Will create all non-existing path components.
-
createDirSync(
Path path) → Result< (), IoError> - Creates the directory if it doesn't exist. Does not create intermediate directories if they do not exist - see Fs.createDirAll.
-
createFile(
Path path) → FutureResult< File, IoError> - Creates a file at the specified path if it does not exist, and will truncate it if it does. The target directory must exist.
-
createFileSync(
Path path) → Result< File, IoError> - Creates a file at the specified path if it does not exist, and will truncate it if it does. The target directory must exist.
-
createNewFile(
Path path) → FutureResult< File, IoError> - Creates a file at the specified path if it does not exist, and will fail if it does. The target directory must exist.
-
createNewFileSync(
Path path) → Result< File, IoError> - Creates a file at the specified path if it does not exist, and will fail if it does. The target directory must exist.
-
createSymlink(
Path original, Path link) → FutureResult< (), IoError> -
Creates a symbolic link at
link
pointing tooriginal
. -
createSymlinkSync(
Path original, Path link) → Result< (), IoError> -
Creates a symbolic link at
link
pointing tooriginal
. -
exists(
Path path) → FutureResult< bool, IoError> - Returns Ok(true) if the path points at an existing entity.
-
existsSync(
Path path) → Result< bool, IoError> - Returns Ok(true) if the path points at an existing entity.
-
ioGuard<
T> (Future< T> fn()) → FutureResult<T, IoError> -
ioGuardResult<
T> (FutureResult< T, IoError> fn()) → FutureResult<T, IoError> -
ioGuardResultSync<
T> (Result< T, IoError> fn()) → Result<T, IoError> -
ioGuardSync<
T> (T fn()) → Result< T, IoError> -
metadata(
Path path) → FutureResult< Metadata, IoError> -
Asynchronously calls the operating system's
stat()
function (or equivalent) onpath
. -
metadataSync(
Path path) → Result< Metadata, IoError> -
Asynchronously calls the operating system's
stat()
function (or equivalent) onpath
. -
move(
Path from, Path to) → FutureResult< (), IoError> - Moves a file or directory, possibly just a rename operation.
-
moveSync(
Path from, Path to) → Result< (), IoError> - Moves a file or directory, possibly just a rename operation.
-
read(
Path path) → FutureResult< Uint8List, IoError> - Reads the entire file contents of a file as bytes.
-
readDir(
Path path) → FutureResult< ReadDir, IoError> - Returns a list with the entries within a directory.
-
readDirSync(
Path path) → Result< ReadDir, IoError> - Returns a list with the entries within a directory.
-
readLink(
Path path) → FutureResult< Path, IoError> - Reads a symbolic link, returning the file that the link points to.
-
readLinkSync(
Path path) → Result< Path, IoError> - Reads a symbolic link, returning the file that the link points to.
-
readSync(
Path path) → Result< Uint8List, IoError> - Reads the entire file contents of a file as bytes.
-
readToString(
Path path) → FutureResult< String, IoError> - Reads the entire contents of a file into a string.
-
readToStringSync(
Path path) → Result< String, IoError> - Reads the entire contents of a file into a string.
-
removeDir(
Path path) → FutureResult< (), IoError> - Removes an empty directory.
-
removeDirAll(
Path path) → FutureResult< (), IoError> - Removes a directory at this path, after removing all its contents. Use carefully!
-
removeDirAllSync(
Path path) → Result< (), IoError> - Removes a directory at this path, after removing all its contents. Use carefully!
-
removeDirSync(
Path path) → Result< (), IoError> - Removes an empty directory.
-
removeFile(
Path path) → FutureResult< (), IoError> - Removes a file.
-
removeFileSync(
Path path) → Result< (), IoError> - Removes a file.
-
rename(
Path path, String newName) → FutureResult< (), IoError> -
Renames a file or directory.
Note this is different from the rust
rename
as this is just a rename, for an equivalent use - move. -
renameSync(
Path path, String newName) → Result< (), IoError> -
Renames a file or directory.
Note this is different from the rust
rename
as this is just a rename, for an equivalent use - move. -
write(
Path path, Uint8List bytes) → FutureResult< (), IoError> - Writes the entire contents of a file.
-
writeString(
Path path, String contents) → FutureResult< (), IoError> - Writes the entire contents of a file as a string.
-
writeStringSync(
Path path, String contents) → Result< (), IoError> - Writes the entire contents of a file as a string.
-
writeSync(
Path path, Uint8List bytes) → Result< (), IoError> - Writes the entire contents of a file.
Constants
- isIoSupported → const bool
- Returns whether io operations are supported. If false, is currently running on the web.