deleteEntry function

void deleteEntry(
  1. String path
)

Deletes whatever's at path, whether it's a file, directory, or symlink.

If it's a directory, it will be deleted recursively.

Implementation

void deleteEntry(String path) {
  _attempt('delete entry', () {
    if (linkExists(path)) {
      Link(path).deleteSync();
    } else if (dirExists(path)) {
      Directory(path).deleteSync(recursive: true);
    } else if (fileExists(path)) {
      File(path).deleteSync();
    }
  });
}