FileScrewdriver extension

provides extensions for File

on

Properties

isEmpty Future<bool>
Returns a Future containing a bool indicating whether this file is empty or not.
no setter
isEmptySync bool
Returns true if this file is empty
no setter

Methods

appendBytes(List<int> value) Future<void>
Appends value bytes at the end of the file.
appendBytesSync(List<int> value) Future<void>
Appends value bytes at the end of the file.
appendFrom(File file) Future<void>
Appends content of file at the end of this file.
appendFromSync(File file) → void
Appends content of file at the end of this file.
appendString(String value, {Encoding encoding = utf8}) Future<void>
Appends value string at the end of the file using provided encoding.
appendStringLine(String value, {Encoding encoding = utf8}) Future<void>
Appends value string as a new line at the end of the file using provided encoding.
appendStringSync(String value, {Encoding encoding = utf8}) → void
Appends value string at the end of the file using provided encoding.
clear() Future<void>
Asynchronously flushes all the data in this file leaving it to be empty.
clearSync() → void
Synchronously flushes all the data in this file leaving it to be empty.
copyTo(File other) Future<void>
Copies content of this to other file.
onDeleted(void block()) StreamSubscription<FileSystemEvent>
Calls block whenever the this file is deleted. Returns StreamSubscription which allows to cancel the listener.
onModified(void block()) StreamSubscription<FileSystemEvent>
Calls block whenever the this file is modified. Returns StreamSubscription which allows to cancel the listener.

Operators

operator +(File file) → void
Allows to append content of file to this.
operator <<(String value) → void
operator that allows to append value string at the end of the file using provided UTF-8 encoding.