W3cubDocs

/Dart 2

typeSync method

FileSystemEntityType typeSync (String path, { bool followLinks: true })

Synchronously finds the type of file system object that a path points to.

Returns a FileSystemEntityType.

FileSystemEntityType has the constant instances file, directory, link, and notFound. 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, notFound is returned. The only error or exception that may be thrown is ArgumentError, caused by passing the wrong type of arguments to the function.

Implementation

static FileSystemEntityType typeSync(String path, {bool followLinks: true}) {
  return _getTypeSync(_toUtf8Array(path), followLinks);
}

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