commit | 571432e93a06f152a9ed5b6387deb8121e333579 | [log] [tgz] |
---|---|---|
author | Todd Volkert <tvolkert@users.noreply.github.com> | Fri Jan 06 10:35:10 2017 -0800 |
committer | GitHub <noreply@github.com> | Fri Jan 06 10:35:10 2017 -0800 |
tree | f76bff1c0b1b97837636b76ff71dad44c2402e94 | |
parent | 1c2ed7e611acd955fea2a843ab610904e1030316 [diff] |
Broaden legal types for directory(), file(), and link() methods (#54) This changes the FileSystem entity creation methods to allow `String`, `Uri`, or `FileSystemEntity` as arguments. This not only provides parity with dart:io's `fromUri()` factory constructors, but it allows the caller to easily wrap a native dart:io entity.
A generic file system abstraction for Dart.
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/memory.dart'; var fs = new MemoryFileSystem();
Use the local file system (requires dart:io access):
import 'package:file/local.dart'; var fs = const LocalFileSystem();