Util.File.Abstraction
6.0.1
See the version list below for details.
dotnet add package Util.File.Abstraction --version 6.0.1
NuGet\Install-Package Util.File.Abstraction -Version 6.0.1
<PackageReference Include="Util.File.Abstraction" Version="6.0.1" />
paket add Util.File.Abstraction --version 6.0.1
#r "nuget: Util.File.Abstraction, 6.0.1"
// Install Util.File.Abstraction as a Cake Addin #addin nuget:?package=Util.File.Abstraction&version=6.0.1 // Install Util.File.Abstraction as a Cake Tool #tool nuget:?package=Util.File.Abstraction&version=6.0.1
This is an easy way of writing/reading files. This might be useful for state management, or quick prototyping.
For example, you can save files to the current directory with the syntax: someObject.ToFile();
For example: 256.ToFile(); This will write the number 256 to a file.
Then, you can display the file with FileAbstract.DisplayFile(); (It will figure out how to find the file automatically)
You can also specify specific paths, but the FileAbstract library will try to find your file based on the name, even if it is not found. For example:
"This was found in my user folder".ToFile( Path.Combine(@"C:","Users",$"{ Environment.UserName}", "Downloads", "myFile.txt")); FileAbstract.DisplayFile("myFile.txt");
You can get creative, and serialise objects to/from files, for example:
var c = new Computer(); c.ToFile(); var savedC = FileAbstract.ReadBinFile<Computer>(); Console.WriteLine(savedC.Name);
I would love to get feedback, or review any pull requests.
Divan van Zyl 2023
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
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.