Thunder.Files
1.3.0
dotnet add package Thunder.Files --version 1.3.0
NuGet\Install-Package Thunder.Files -Version 1.3.0
<PackageReference Include="Thunder.Files" Version="1.3.0" />
paket add Thunder.Files --version 1.3.0
#r "nuget: Thunder.Files, 1.3.0"
// Install Thunder.Files as a Cake Addin #addin nuget:?package=Thunder.Files&version=1.3.0 // Install Thunder.Files as a Cake Tool #tool nuget:?package=Thunder.Files&version=1.3.0
Thunder.Files
Offers a basic interface to work with files and directories
How to Use
This library provides a basic wrapper around DirectoryInfo
and FileInfo
that conforms to the provided IDirectory
and IFile
interfaces. These interfaces also have some additional helpers.
To get the an IFile, you can do any of these:
IFile file1 = new FileInfoWrapper("/path/to/file.txt");
IFile file2 = "/path/to/file.txt".AsFile();
IFile file3 = new FileInfo("/path/to/file.txt").Wrap();
IFile file4 = new FileInfoWrapper(new FileInfo("/path/to/file.txt"));
With an IFile
, you can use the interface to:
- Copy to another file
- Create the file
- Delete the file
- Find, get, or create siblings
- Rename the file
- Move the file
- Open the file stream
- Write or read file contents
Why?
This exists mainly to help mock file systems when possible when working with files in testing.
Roadmap
- A potential path is to allow/permit semi-automatic file reading/writing based on various rules or configurations. For example, assuming a rule that a
*.json
file can always be read/written via aJsonReaderWriter
, then we could simplify reading/writing to:
var file = "my-file.json".AsFile();
//from needing to specify type of reader or writer:
var readerWriter = new JsonReaderWriter();
var results = file.ReadContents<TestObject>(readerWriter);
//to system automatically finding reader/writer based on "json" extension:
var results = file.ReadContents<TestObject>();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Thunder.Files:
Package | Downloads |
---|---|
Thunder.Files.Json
A small library that provides a JsonReaderWriter that works with IFile from Thunder.Files. |
GitHub repositories
This package is not used by any popular GitHub repositories.
This library is brand new and has limited features.