commit | f855b82b46bdec0e8b2c2f6772bf53eb0984ac67 | [log] [tgz] |
---|---|---|
author | Todd Volkert <tvolkert@users.noreply.github.com> | Thu Dec 15 10:08:58 2016 -0800 |
committer | GitHub <noreply@github.com> | Thu Dec 15 10:08:58 2016 -0800 |
tree | dd3df40f16fef1696eed378803c9d95901321f36 | |
parent | 3fb948885b7292449ba8001ce1b0169bee767ad9 [diff] |
Factor out Forwarding classes; use them in local backend (#21) These classes will also be the basis of a ChrootFileSystem, which is forthcoming.
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`;