create method

  1. @override
Future<void> create([
  1. String? parent
])
override

Creates this entry within the parent directory, which defaults to sandbox.

Implementation

@override
Future<void> create([String? parent]) async {
  // Create the stream before we call [File.openWrite] because it may fail
  // fast (e.g. if this is a matcher file).
  var file = File(p.join(parent ?? sandbox, name)).openWrite();
  try {
    await readAsBytes().listen(file.add).asFuture();
  } finally {
    await file.close();
  }
}