FileStat class

A FileStat object represents the result of calling the POSIX stat() function on a file system object. It is an immutable object, representing the snapshotted values returned by the stat() call.

Static Methods

stat(String path) → Future<FileStat>

Asynchronously calls the operating system's stat() function on path. Returns a Future which completes with a FileStat object containing the data returned by stat(). If the call fails, completes the future with a FileStat object with .type set to FileSystemEntityType.NOT_FOUND and the other fields invalid.

statSync(String path) → FileStat

Calls the operating system's stat() function on path. Returns a FileStat object containing the data returned by stat(). If the call fails, returns a FileStat object with .type set to FileSystemEntityType.NOT_FOUND and the other fields invalid.

Properties

accessedDateTime
final

The time of the last access to the data of the file system object. On Windows platforms, this may have 1 day granularity, and be out of date by an hour.

changedDateTime
final

The time of the last change to the data or metadata of the file system object. On Windows platforms, this is instead the file creation time.

modeint
final

The mode of the file system object. Permissions are encoded in the lower 16 bits of this number, and can be decoded using the modeString getter.

modifiedDateTime
final

The time of the last change to the data of the file system object.

sizeint
final

The size of the file system object.

typeFileSystemEntityType
final

The type of the object (file, directory, or link). If the call to stat() fails, the type of the returned object is NOT_FOUND.

hashCodeint
read-only, inherited

The hash code for this object.

runtimeTypeType
read-only, inherited

A representation of the runtime type of the object.

Operators

operator ==(other) → bool
inherited

The equality operator.

Methods

modeString() → String

Returns the mode value as a human-readable string, in the format "rwxrwxrwx", reflecting the user, group, and world permissions to read, write, and execute the file system object, with "-" replacing the letter for missing permissions. Extra permission bits may be represented by prepending "(suid)", "(guid)", and/or "(sticky)" to the mode string.

toString() → String

Returns a string representation of this object.

noSuchMethod(Invocation invocation) → dynamic
inherited

Invoked when a non-existent method or property is accessed.

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-io/FileStat-class.html