pub repository
mirror.p-hatan.comfile
7.0.1A pluggable, mockable file system abstraction for Dart. Supports local file system access, as well as in-memory file systems, record-replay file systems, and chroot file systems.
Cached in Iran · upstream_checksum
Readme
package:file pub package package publisher
A generic file system abstraction for Dart.
Features
Like dart:io, package:file supplies a rich Dart-idiomatic API for accessing
a file system.
Unlike dart:io, package:file:
- Can be used to implement custom file systems.
- Comes with an in-memory implementation out-of-the-box, making it super-easy to test code that works with the file system.
- Allows using multiple file systems simultaneously. A file system is a first-class object. Instantiate however many you want and use them all.
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/memory.dart';
var fs = MemoryFileSystem();
Use the local file system (requires dart:io access):
import 'package:file/local.dart';
var fs = const LocalFileSystem();
Changelog
7.0.1
- Update the pubspec repository field to reflect the new package repository.
7.0.0
- Dart 3 fixes for class modifiers.
- Require Dart 3.0.
MemoryFileSystemnow treats empty paths as non-existent.- Fix
FileSystem.isLink/FileSystem.isLinkSyncto not follow symbolic links. - Make the return type of
MemoryFile.openReadand_ChrootFile.openReadagain match the return type fromdart:io.
6.1.4
- Populate the pubspec
repositoryfield.
6.1.3
- In classes that implement
Filemethodscreate,createSyncnow takebool exclusive = trueparameter. No functional changes.
6.1.2
MemoryFileSystemnow providesopHandles for exists operations.
6.1.1
MemoryFilenow providesopHandles for copy and open operations.
6.1.0
- Reading invalid UTF8 with the
MemoryFileSystemnow correctly throws aFileSystemExceptioninstead of aFormatError. MemoryFileSystemnow provides anopHandleto inspect read/write operations.MemoryFileSystemnow creates the temporary directory before returning increateTemp/createTempSync.
6.0.1
- Fix sound type error in memory backend when reading non-existent
MemoryDirectory.
6.0.0
- First stable null safe release.
6.0.0-nullsafety.4
- Update upper bound of SDK constraint.
6.0.0-nullsafety.3
- Update upper bound of SDK constraint.
6.0.0-nullsafety.2
- Make
ForwardingFile.openRead's return type again match the return type fromdart:io. - Remove some unnecessary
Uint8Listconversions inForwardingFile.
6.0.0-nullsafety.1
- Update to null safety.
- Remove record/replay functionality.
- Made
MemoryRandomAccessFileandMemoryFile.openWritehandle the file being removed or renamed while open. - Fixed incorrect formatting in
NoMatchingInvocationError.toString(). - Fixed more test flakiness.
- Enabled more tests.
- Internal cleanup.
- Remove implicit dynamic in preparation for null safety.
- Remove dependency on Intl.
5.2.1
- systemTemp directories created by
MemoryFileSystemwill allot names based on the file system instance instead of globally. MemoryFile.readAsLines()/readAsLinesSync()no longer treat a final newline in the file as the start of a new, empty line.RecordingFile.readAsLine()/readAsLinesSync()now always record a final newline.MemoryFile.flush()now returnsFuture<void>instead ofFuture<dynamic>.- Fixed some test flakiness.
- Enabled more tests.
- Internal cleanup.
5.2.0
- Added a
MemoryRandomAccessFileclass and implementedMemoryFile.open()/openSync().
5.1.0
- Added a new
MemoryFileSystemconstructor to use a test clock
5.0.10
- Added example
5.0.9
- Fix lints for project health
5.0.8
- Return
Uint8Listrather thanList<int>.
5.0.7
- Dart 2 fixes for
RecordingProxyMixinandReplayProxyMixin.
5.0.6
- Dart 2 fixes for
RecordingFile.open()
5.0.5
- Dart 2 fixes
5.0.4
- Update SDK constraint to 2.0.0-dev.67.0, remove workaround in recording_proxy_mixin.dart.
- Fix usage within Dart 2 runtime mode in Dart 2.0.0-dev.61.0 and later.
- Relax constraints on
package:test
5.0.3
- Update
package:testdependency to 1.0
5.0.2
- Declare compatibility with Dart 2 stable
5.0.1
- Remove upper case constants
- Update SDK constraint to 2.0.0-dev.54.0.
5.0.0
- Moved
testinglibrary into a dedicatedpackage:file_testingso that libraries don't need to take on a transitive dependency onpackage:testin order to usepackage:file.
4.0.1
- General library cleanup
- Add
stylesupport inMemoryFileSystem, so that callers can choose to have a memory file system with windows-like paths. [#68] (https://github.com/google/file.dart/issues/68)
4.0.0
- Change method signature for
RecordingRandomAccessFile._closeto return aFuture<void>instead ofFuture<RandomAccessFile>. This follows a change in dart:io, Dart SDK2.0.0-dev.40.
3.0.0
- Import
dart:iounconditionally. More recent Dart SDK revisions allowdart:ioto be imported in a browser context, though if methods are actually invoked, they will fail. This matches well withpackage:file, where users can use thememorylibrary and get in-memory implementations of thedart:iointerfaces. - Bump minimum Dart SDK to
1.24.0
2.3.7
- Fix Dart 2 error.
2.3.6
- Relax sdk upper bound constraint to '<2.0.0' to allow 'edge' dart sdk use.
2.3.5
- Fix internal use of a cast which fails on Dart 2.0 .
2.3.4
- Bumped maximum Dart SDK version to 2.0.0-dev.infinity
2.3.3
- Relaxes version requirements on
package:intl
2.3.2
- Fixed
FileSystem.directory(Uri),FileSystem.file(Uri), andFileSystem.link(Uri)to consult the file system's path context when converting the URI to a file path rather than usingUri.toFilePath().
2.3.1
- Fixed
MemoryFileSystemto makeFile.writeAs...()update the last modified time of the file.
2.3.0
- Added the following convenience methods in
Directory:Directory.childDirectory(String basename)Directory.childFile(String basename)Directory.childLink(String basename)
2.2.0
- Added
ErrorCodesclass, which holds errno values.
2.1.0
- Add support for new
dart:ioAPI methods added in Dart SDK 1.23
2.0.1
- Minor doc updates
2.0.0
- Improved
toStringimplementations in file system entity classes - Added
ForwardingFileSystemand associated forwarding classes to the mainfilelibrary - Removed
FileSystem.pathSeparator, and added a more comprehensiveFileSystem.pathproperty - Added
FileSystemEntity.basenameandFileSystemEntity.dirname - Added the
record_replaylibrary - Added the
testinglibrary
1.0.1
- Added
FileSystem.systemTempDirectory - Added the ability to pass
UriandFileSystemEntitytypes toFileSystem.directory(),FileSystem.file(), andFileSystem.link() - Added
FileSystem.pathSeparator
1.0.0
- Unified interface to match dart:io API
- Local file system implementation
- In-memory file system implementation
- Chroot file system implementation
0.1.0
- Initial version
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add filepubspec.yaml
name: file
version: 7.0.1
description:
A pluggable, mockable file system abstraction for Dart. Supports local file
system access, as well as in-memory file systems, record-replay file systems,
and chroot file systems.
repository: https://github.com/dart-lang/tools/tree/main/pkgs/file
environment:
sdk: ^3.0.0
dependencies:
meta: ^1.9.1
path: ^1.8.3
dev_dependencies:
file_testing: ^3.0.0
lints: ^2.0.1
test: ^1.23.1
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.0.1-dev+1 | 2015-06-06T21:07:59.773Z | Cached | 3cc0d166f756c47c0f6544dcd29e0297734f81abb4e93086abb573f781af6b80 |
| 0.1.0 | 2016-02-20T01:47:26.496Z | Cached | d6bd893d6a830a0996b75c5eb105175b85e72e4b1972dc8462430231d6eedbb6 |
| 1.0.0 | 2017-01-06T00:13:48.466Z | Cached | c017ee899f372223b09503e9187bd78816547843081aa48228fbb31a2b557784 |
| 1.0.1 | 2017-01-07T00:23:19.209Z | Cached | 13839ca10dd9722f508cfe02e2416698f6ef9515b4906a7f257a97fb49e90fd7 |
| 2.0.0 | 2017-02-12T21:18:05.639Z | Cached | 4fd115f773f2ec7ab6e396618108d79f2eb08c3e8a310eaca333132fa84d209b |
| 2.0.1 | 2017-02-12T21:39:37.377Z | Cached | e4def64d44631f1343cd713761cf43ac52d457c6000b7336339f3ad4c5ae6adb |
| 2.1.0 | 2017-02-21T19:09:31.483Z | Cached | eee25073e50043245be2dc2c8dede2612d78fab76630078fea4cef85ec0daab4 |
| 2.2.0 | 2017-02-22T21:24:27.190Z | Cached | 63782ee1ccbd2fc2b9900d268a867ffc0c449e3dcbf7c3a17d7d26f33cf5f10d |
| 2.3.0 | 2017-02-27T21:28:41.168Z | Cached | b6696c64c11668746336682de3d5b788e63639cb55caeefd569d65889078ba6a |
| 2.3.1 | 2017-03-15T17:55:24.847Z | Cached | 54fe5baf8d14fcf5be08d1797d88feedf6bef2b0f66c02704121236298ce8a24 |
| 2.3.2 | 2017-03-27T19:23:22.852065Z | Cached | a15abc2810f1be5dc61fc33dee34a676089b362363d92cfc5cdc1104222f9f98 |
| 2.3.3 | 2017-07-11T22:08:20.070998Z | Cached | 80fabe80d1b31423653be9e118bfffc1aa1b39d607480aefca5ef4aff033a14e |
| 2.3.4 | 2017-07-13T18:34:19.461531Z | Cached | d3a1d23d3d2c3d19f01a5ce4f0a48694f2a3c8fb23e8a19f80b22ec438527d9a |
| 2.3.5 | 2017-11-22T01:53:28.090902Z | Cached | 7bc78772d78224e76644ea04fcef37236821fe1741015e9f05d3b01323c57c14 |
| 2.3.6 | 2018-02-12T17:51:35.796338Z | Cached | 04dc3a53927d672e9c13c8a10283570450d9e5863112d8a458f60cba2377d84c |
| 2.3.7 | 2018-03-01T18:33:09.152765Z | Cached | 3cbf60b1103aa0b52a2bda88001f205d413081ec04569536b92e202681ddb3c5 |
| 3.0.0 | 2018-03-20T19:19:16.923547Z | Cached | 82ce8df7bcd4b80c947eb711b09fc76a3490cac3fc2e2ba7eaf1f30718bf4582 |
| 4.0.0 | 2018-04-06T16:37:28.656843Z | Cached | cd9d867c0e43de0baf891f01b9419e33e71f03601b3d1659b70499aae03f58c4 |
| 4.0.1 | 2018-04-10T00:22:41.268568Z | Cached | a75069dea76b6a6a53ee9d4fdfd4ea2bff2a8b58afae2185e8eca7d6ee5d96cb |
| 5.0.0 | 2018-04-10T20:46:44.818032Z | Cached | 9ef40f1d197aba5b6dccc46a870ff940a4b24ba9d59dc93cf0aa4192c0a74533 |
| 5.0.1 | 2018-05-21T19:56:30.323176Z | Cached | 00ad80210dc77fbd18632c010410291a882439cac7c2a88949b0e66fb600e71d |
| 5.0.2 | 2018-08-13T17:38:37.103699Z | Cached | 792a94b695f33204ac9eb65b18b46fc9b2d79a7257d1e06b54e419aa802613bf |
| 5.0.3 | 2018-08-13T17:38:55.235558Z | Cached | 4627e7571cc22485160b80ce0d9c8cea153a0bcb403e8fe860580fdeba8fdb67 |
| 5.0.4 | 2018-08-14T16:59:16.046144Z | Cached | a9018b67a0882db544008038c747448e11aa7c7db1d78d72809f3bfd098fa2bc |
| 5.0.5 | 2018-08-29T23:28:53.434377Z | Cached | f1e79c82508d7534a8ed3b8e0a489ad07dca5e67f4c51add3f313049379d0c9f |
| 5.0.6 | 2018-08-30T20:25:41.261001Z | Cached | 30c85b02d4f2208914e69d6d402376630165cec74e9b7cfae96d9bec6e2a8975 |
| 5.0.7 | 2018-12-07T22:35:24.151421Z | Cached | 820bf8dea7c69a3af332276a926b071e539b6562798390e89ffa91540f041bde |
| 5.0.8 | 2019-05-20T16:44:42.391359Z | Cached | bfcd497808d2148d625a49eeadf6728badee599bfa4578eed3300e4b6c437ec2 |
| 5.0.8+1 | 2019-06-25T00:38:29.612256Z | Cached | 6cf7e73d0e388426bb7e6ed63173a3aecca77890f010f9d2bc6f50b90e40c515 |
| 5.0.9 | 2019-08-31T17:16:53.915108Z | Cached | 5f12d4ae159797c1d92088e287080301d366ad458b9ba0546c56ee5dbc5542f8 |
| 5.0.10 | 2019-08-31T19:09:08.564363Z | Cached | 3a58e2625ab660d0737e8efc06759d6491d011c5609055464f422f0938f52524 |
| 5.1.0 | 2019-10-11T03:36:32.164254Z | Cached | 657a39c74f63d20c2118455e568b33ee31aa370f258c261888cae4e934371199 |
| 5.2.0 | 2020-06-15T19:00:00.350242Z | Cached | 53c5c2c2e599bcb973819441dbcacf71482d3401da1ed3785e5c8e3203f8cfbf |
| 5.2.1 | 2020-06-23T20:19:04.424537Z | Cached | 781811e896666e9a728fd85b13129e32d73f05167a5da1891739f4609c6a8d7d |
| 6.0.0-nullsafety.1 | 2020-08-11T16:50:50.681296Z | Cached | 29704684177dfa417ab6393c001747c07b53f85e859029861405d7493ced7056 |
| 6.0.0-nullsafety.2 | 2020-09-22T20:42:08.068656Z | Cached | dcabc93cf82f0c89c84d51aaa38f0ff68b9ef097d8fe7bd6685c8595d73e65b9 |
| 6.0.0-nullsafety.3 | 2020-10-22T17:07:17.758616Z | Cached | e5a9cb986deec9344e419cad110559e8afdfb44c9917ac07f53572b2fbeabc9c |
| 6.0.0-nullsafety.4 | 2020-11-04T18:50:31.881928Z | Cached | 2d81aa2316bf3394c7cf924f5271d7637553d145a037e570fdd1caa1d642269d |
| 6.0.0 | 2021-02-03T18:01:22.439041Z | Cached | 716a02ed2fabe2d0cc0fa0bcaefae83c412e8aef6c559aa394ed7c12ec5b981b |
| 6.0.1 | 2021-02-17T20:46:04.080588Z | Cached | 9995afccf6ceb3836f79db1d14ac2e9df3166997b87d345644dc0f5319d44065 |
| 6.1.0 | 2021-02-18T00:44:43.651186Z | Cached | 9fd2163d866769f60f4df8ac1dc59f52498d810c356fe78022e383dd3c57c0e1 |
| 6.1.1 | 2021-05-17T17:03:34.997472Z | Cached | bbbe4cbd826c19385c87dcb11d07af2b26c98ac9ed94c1cd65172818570e25b2 |
| 6.1.2 | 2021-06-15T16:07:16.878909Z | Cached | b69516f2c26a5bcac4eee2e32512e1a5205ab312b3536c1c1227b2b942b5f9ad |
| 6.1.3 | 2022-08-17T17:57:20.743693Z | Cached | 6552d6d6b990a79c50e3742aa878113e0c1ec31613448951931b9c355e51bb26 |
| 6.1.4 | 2022-08-18T15:59:43.867556Z | Cached | 1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d |
| 7.0.0 | 2023-05-19T16:36:21.543943Z | Cached | 5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c |
| 7.0.1 | 2024-10-08T15:54:11.380188Z | Cached | a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 |
Dependencies
meta "^1.9.1"
path "^1.8.3"