Update README to show basics of use.
1 file changed
tree: 71670718fc07ac3f8b4902dbf3835d46565390a3
  1. contrib/
  2. lib/
  3. test/
  4. .gitignore
  5. LICENSE
  6. pubspec.yaml
  7. README.md
README.md

File

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:

  • Has an entirely async public interface (no fooSync methods).
  • Has explicit factory classes for different implementations.
  • Can be used to implement custom file systems.

Usage

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();