deleteOpfsFile function

Future<void> deleteOpfsFile(
  1. String path
)

Deletes the logical file at path and every OPFS entry it owns.

Do not call this while another instance of the same file is open: its chunk handles hold exclusive locks. Use BytesFile.delete() instead when you have a handle.

Implementation

Future<void> deleteOpfsFile(String path) async {
  final normalized = normalizeLogicalPath(path);
  final pool = await OpfsWorkerPool.instance();
  await pool.manifest.remove(storePathFor(normalized), recursive: true);
}