openExisting static method

Future<DurableFileStorageBackend> openExisting(
  1. String path, {
  2. required bool directoryEntryIsDurable,
})

Implementation

static Future<DurableFileStorageBackend> openExisting(String path,
    {required bool directoryEntryIsDurable}) async {
  if (!directoryEntryIsDurable) {
    throw UnsupportedError('A durably provisioned existing file is required');
  }
  if ((await File(path).stat()).type != FileSystemEntityType.file) {
    throw FileSystemException('Existing regular file required', path);
  }
  return DurableFileStorageBackend._(
      await File(path).open(mode: FileMode.append));
}