fs_shim 1.0.2 copy "fs_shim: ^1.0.2" to clipboard
fs_shim: ^1.0.2 copied to clipboard

outdated

A portable file system implementation working on io, browser and memory (through idb_shim)

example/example.dart

import 'package:fs_shim/fs_shim.dart';
import 'package:path/path.dart';

Future main() async {
  final fs = fileSystemMemory;

  // Create a top level directory
  final dir = fs.directory('/dir');

  // and a file in it
  final file = fs.file(join(dir.path, 'file'));

  // create a file
  await file.create(recursive: true);
  await file.writeAsString('Hello world!');

  // read a file
  print('file: ${await file.readAsString()}');

  // use a file link if supported
  if (fs.supportsFileLink) {
    final link = fs.link(join(dir.path, 'link'));
    await link.create(file.path);

    print('link: ${await fs.file(link.path).readAsString()}');
  }

  // list dir content
  print(await dir.list(recursive: true, followLinks: true).toList());
}
6
likes
0
pub points
86%
popularity

Publisher

verified publishertekartik.com

A portable file system implementation working on io, browser and memory (through idb_shim)

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

idb_shim, meta, path, sembast

More

Packages that depend on fs_shim