Skip to content

Instantly share code, notes, and snippets.

@kasperpeulen
Created August 2, 2015 00:10
Show Gist options
  • Select an option

  • Save kasperpeulen/67214080a24bb3d07bf4 to your computer and use it in GitHub Desktop.

Select an option

Save kasperpeulen/67214080a24bb3d07bf4 to your computer and use it in GitHub Desktop.
Use the FilesSystemEntity deleteSync() method to delete a file, directory, or symlink. This method is inherited by File, Directory, and Link.
import 'dart:io';
main() async {
// Create a temporary directory.
Directory dir = Directory.systemTemp.createTempSync();
// Confirm it exists.
print(dir.existsSync());
// Delete the directory.
dir.deleteSync();
// Confirm it no longer exists.
print(dir.existsSync());
}
name: dart.io_FilesSystemEntity.deleteSync
description: |
Use the FilesSystemEntity deleteSync() method to delete a file, directory,
or symlink. This method is inherited by File, Directory, and Link.
environment:
sdk: '>=1.11.0 <2.0.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment