FileSync class Null safety

Implements static functions for files and directories in the sync variant.

Constructors

FileSync([BaseLogger? logger])
The public constructor. If logger is null an isolated instance is returned. Otherwise a singleton. Note: normally the singleton instance should be used. Only in special cases like different threads ("isolates") isolated instances will be meaningful.
factory

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

ensureDirectory(String path, {int? mode, int? owner, int? group, bool clear = false}) bool
ensureDoesNotExist(String filename, {bool recursive = false}) → void
extensionOf(String path) String
Returns the extension of the path. The extension is the part behind the last '.'. If the only '.' is at the top, the result is '' otherwise the the last part with '.'. deprecated: Use extension() from package path
fileAsString(String filename) String
filenameOf(String path) String
Returns the extension of the path. The extension is the part behind the last '.'. If the only '.' is at the top, the result is '' otherwise the the last part with '.'. deprecated: Use basename() from package path
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
tempDirectory(String node, {String? subDirs}) String
toFile(String filename, String? content, {DateTime? date, String? dateAsString, bool asTransaction = false, bool inline = false, int? mode, bool createDirectory = false}) → void
toString() String
A string representation of this object. [...]
inherited

Operators

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

Static Properties

currentDirSep String
final
sep String
final

Static Methods

humanSize(int size) String
Returns a human readable string of a file size, e.g. '2.389MB'.
initialize(BaseLogger logger) FileSync
joinPaths(String first, String second, [String? third]) String
Joins parts to a combined path. first: first part second: second part third: third part deprecated: Use join() from package path
nativePath(String path, {String? appendix, List<String>? appendixes, String? nativeSep}) String
Joins path components and converts the '/' to the native path separator. path the base path appendix will be appended to the path appendixes a list of nodes to append to the path nativeSep the native separator. If null the global native path separator is used
nodeOf(String path) String
Returns the filename of the path without path. Example: base('abc/def.txt') == 'def.txt' deprecated: Use basename() from package path
parentOf(String path) String
Returns the parent directory of the path. Example: dirname('abc/def.txt') == 'abc/' deprecated: Use dirname() from package path