exists function

bool exists(
  1. String path, {
  2. bool followLinks = true,
})

Returns true if the given path exists. It may be a file, directory or link.

If followLinks is true (the default) then exists will return true if the resolved path exists.

If followLinks is false then exists will return true if path exist, whether its a link or not.

if (exists("/fred.txt"))

Throws ArgumentError if path is null or an empty string.

See isLink isDirectory isFile

Implementation

bool exists(String path, {bool followLinks = true}) =>
    _Is().exists(path, followLinks: followLinks);