Skip to main content

tom_file_system 0.1.0 copy "tom_file_system: ^0.1.0" to clipboard
tom_file_system: ^0.1.0 copied to clipboard

One file-system contract for every Tom application — atomic writes, revision-checked saves, delete to the platform's trash, links that never leave the root, values instead of dart:io objects — with an [...]

example/tom_file_system_example.dart

import 'package:tom_file_system/tom_file_system.dart';

Future<void> main() async {
  final fs = TomMemoryFileSystem(seed: {'/notes.txt': 'first line\n'});
  final read = await fs.read(fs.uriOf('notes.txt'));
  // Refused with a TomFileConflict if somebody changed the file since.
  await fs.writeText(
    fs.uriOf('notes.txt'),
    'second line\n',
    expected: read.revision,
  );
  print(await fs.readText(fs.uriOf('notes.txt')));
}
0
likes
150
points
46
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

One file-system contract for every Tom application — atomic writes, revision-checked saves, delete to the platform's trash, links that never leave the root, values instead of dart:io objects — with an in-memory and a local implementation (watching, freedesktop.org trash, Windows Recycle Bin).

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

crypto, ffi, path

More

Packages that depend on tom_file_system