commit | d9a0e72fd5a7824bcdae5ee1257bfe9ff5e3fef8 | [log] [tgz] |
---|---|---|
author | Todd Volkert <tvolkert@users.noreply.github.com> | Fri Dec 09 08:15:20 2016 -0800 |
committer | GitHub <noreply@github.com> | Fri Dec 09 08:15:20 2016 -0800 |
tree | 200595eae29205f22a456ebc61728085bcc3458c | |
parent | 18a00a35959f01a36a52596813a25255b4d5f06a [diff] |
Implement LocalFileSystem with new interface (#8)
A generic file system abstraction for Dart.
This package is currently experimental and subject to change
Like dart:io
, package:file
supplies a rich Dart-idiomatic API for accessing a file system.
Unlike dart:io
, package:file
:
Implement your own custom file system:
import 'package:file/file.dart'; class FooBarFileSystem implements FileSystem { ... }
Use the in-memory file system:
import 'package:file/file.dart'; var fs = new InMemoryFileSystem();
Use the local file system (requires dart:io access):
import 'package:file/io.dart'; var fs = const LocalFileSystem();
The synchronous counterparts can be imported from:
// API and in-memory implementation import `package:file/sync.dart`; // Implementation based on "dart:io" import `package:file/sync_io.dart`;