exists method

  1. @override
Future<Result<bool, FileError>> exists(
  1. String path
)
override

Returns false for missing paths; other errors surface as Err.

Implementation

@override
Future<Result<bool, FileError>> exists(String path) async {
  final resolved = _resolve(path);
  try {
    final type = await FileSystemEntity.type(resolved, followLinks: false);
    return Ok(type != FileSystemEntityType.notFound);
  } on Object catch (error) {
    return Err(_toFileError(error, resolved));
  }
}