Skip to content

Instantly share code, notes, and snippets.

@kyorohiro
Last active January 18, 2018 22:21
Show Gist options
  • Save kyorohiro/c0ba7ed0ef75d565fa03f7142e78f9f4 to your computer and use it in GitHub Desktop.
Save kyorohiro/c0ba7ed0ef75d565fa03f7142e78f9f4 to your computer and use it in GitHub Desktop.
abstract class File {
Future<int> writeAsBytes(List<int> buffer, int offset);
Future<List<int>> readAsBytes(int offset, int length);
Future<int> getLength();
Future<int> truncate(int fileSize);
Future<File> close();
}
abstract class FileSystem {
Future<FileSystem> checkPermission();
Future<FileSystem> mkdir(String path);
Future<FileSystem> rm(String path,{bool recursive: false});
Stream<String> ls(String path);
Future<File> open(String path);
Future<String> getHomeDirectory();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment