Created
February 6, 2018 16:35
-
-
Save kyorohiro/70934f314546d0fd0ee11e3cefdc9926 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
part of umiuni2d_io; | |
abstract class Entry { | |
String get name; | |
String get path; | |
Future<bool> isDirectory(); | |
Future<bool> isFile(); | |
} | |
abstract class Directory extends Entry { | |
} | |
abstract class File extends Entry { | |
Future<File> open(); | |
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<Entry> ls(String path); | |
Future<bool> isFile(String path); | |
Future<bool> isDirectory(String path); | |
Future<Entry> wd(); | |
Future<FileSystem> cd(String path); | |
Future<File> open(String path); | |
Future<Entry> getHomeDirectory(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment