type method

Future<FileSystemEntityType> type(String path, { bool followLinks: true })

Finds the type of file system object that a path points to. Returns a Future<FileSystemEntityType> that completes with the result.

FileSystemEntityType has the constant instances FILE, DIRECTORY, LINK, and NOT_FOUND. type will return LINK only if the optional named argument followLinks is false, and path points to a link. If the path does not point to a file system object, or any other error occurs in looking up the path, NOT_FOUND is returned. The only error or exception that may be put on the returned future is ArgumentError, caused by passing the wrong type of arguments to the function.

Source

static Future<FileSystemEntityType> type(String path,
        {bool followLinks: true}) =>
    _getTypeAsync(path, followLinks).then(FileSystemEntityType._lookup);

© 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/FileSystemEntity/type.html