commit | a6cd20494316d6dc5663f7fc5a24238f85bc3980 | [log] [tgz] |
---|---|---|
author | Todd Volkert <tvolkert@users.noreply.github.com> | Mon Dec 12 18:07:15 2016 -0800 |
committer | GitHub <noreply@github.com> | Mon Dec 12 18:07:15 2016 -0800 |
tree | 3605c6958214d46aa9384dea27d9c8e0dd4e13ce | |
parent | 0cb5e782ba73d910e6062e50380e2ee9df697a22 [diff] |
Implement MemoryFile. (#13) This completes the implementation of the in-memory FileSystem backend. Next change will add tests.
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`;