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.
Source
static FileStat statSync(String path) {
// Trailing path is not supported on Windows.
if (Platform.isWindows) {
path = FileSystemEntity._trimTrailingPathSeparators(path);
}
var data = _statSync(path);
if (data is OSError) return FileStat._notFound;
return new FileStat._internal(
new DateTime.fromMillisecondsSinceEpoch(data[_CHANGED_TIME]),
new DateTime.fromMillisecondsSinceEpoch(data[_MODIFIED_TIME]),
new DateTime.fromMillisecondsSinceEpoch(data[_ACCESSED_TIME]),
FileSystemEntityType._lookup(data[_TYPE]),
data[_MODE],
data[_SIZE]);
}