Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (25 loc) · 822 Bytes

README.md

File metadata and controls

40 lines (25 loc) · 822 Bytes

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