FileMixin mixin
File mixin
- Implemented types
Properties
- absolute → File
-
Returns a File instance whose path is the absolute path to
this
.no setteroverride - fs → FileSystem
-
fs_shim specific
holds a reference to the file system
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
. Ifthis
is a root directory, returnsthis
.no setterinherited - path → String
-
Get the path of the file.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copy(
String newPath) → Future< File> -
Copy this file. Returns a
Future<File>
that completes with a File instance for the copied file.override -
create(
{bool recursive = false}) → Future< File> -
Create the file. Returns a
`Future<File>`
that completes with the file when it has been created.override -
delete(
{bool recursive = false}) → Future< FileSystemEntity> -
Deletes this FileSystemEntity.
inherited
-
doReadAsBytes(
) → Future< Uint8List> - Read bytes
-
doWriteAsBytes(
List< int> bytes, {FileMode mode = FileMode.write, bool flush = false}) → Future<FileMixin> - Write bytes
-
doWriteAsString(
String contents, {FileMode mode = FileMode.write, Encoding encoding = utf8, bool flush = false}) → Future< FileMixin> - Write String
-
exists(
) → Future< bool> -
Checks whether the file system entity with this path exists. Returns
a
`Future<bool>`
that completes with the result.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
{FileMode mode = FileMode.read}) → Future< RandomAccessFile> -
Opens the file for random access operations.
override
-
openRead(
[int? start, int? end]) → Stream< Uint8List> -
Create a new independent Stream for the contents of this file.
override
-
openWrite(
{FileMode mode = FileMode.write, Encoding encoding = utf8}) → StreamSink< List< int> > -
Creates a new independent StreamSink for the file. The
StreamSink must be closed when no longer used, to free
system resources.
override
-
readAsBytes(
) → Future< Uint8List> -
Read the entire file contents as a list of bytes. Returns a
`Future<List<int>>`
that completes with the list of bytes that is the contents of the file.override -
readAsString(
{Encoding encoding = utf8}) → Future< String> -
Read the entire file contents as a string using the given
Encoding.
override
-
rename(
String newPath) → Future< FileSystemEntity> -
Renames this file system entity. Returns a
Future<FileSystemEntity>
that completes with a FileSystemEntity instance for the renamed file system entity.inherited -
stat(
) → Future< FileStat> -
Calls the operating system's stat() function on the path of this
FileSystemEntity. Identical to
FileStat.stat(this.path)
.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
writeAsBytes(
Uint8List bytes, {FileMode mode = FileMode.write, bool flush = false}) → Future< File> -
Write a list of bytes to a file.
override
-
writeAsString(
String contents, {FileMode mode = FileMode.write, Encoding encoding = utf8, bool flush = false}) → Future< File> -
Write a string to a file.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited