Soenneker.Utils.File
4.0.2231
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Utils.File --version 4.0.2231
NuGet\Install-Package Soenneker.Utils.File -Version 4.0.2231
<PackageReference Include="Soenneker.Utils.File" Version="4.0.2231" />
<PackageVersion Include="Soenneker.Utils.File" Version="4.0.2231" />
<PackageReference Include="Soenneker.Utils.File" />
paket add Soenneker.Utils.File --version 4.0.2231
#r "nuget: Soenneker.Utils.File, 4.0.2231"
#:package Soenneker.Utils.File@4.0.2231
#addin nuget:?package=Soenneker.Utils.File&version=4.0.2231
#tool nuget:?package=Soenneker.Utils.File&version=4.0.2231
Soenneker.Utils.File
A utility library encapsulating asynchronous file IO operations.
Installation
dotnet add package Soenneker.Utils.File
Quick start
using Soenneker.Utils.File.Registrars;
services.AddFileUtilAsSingleton();
Then inject IFileUtil wherever you need it.
Common operations
Read()- Reads the entire content of a file as a string. Returns a task containing the file content as a string.TryRead()- Tries to read the content of a file as a string. Logs a warning on failure. Returns a task containing the file content as a string or null on failure.ReadAsLines()- Reads the entire content of a file as a list of strings, where each line is an item in the list. Returns a task containing a list of strings representing the file's lines.ReadToBytes()- Reads the entire content of a file as a byte array. Returns a task containing the file content as a byte array.ReadToMemoryStream()- Reads the entire content of a file into a memory stream. Returns a task containing a memory stream with the file content.Write()- Writes a string to a file. Returns a task representing the operation.WriteAllLines()- Writes all lines of text to a file. Returns a task representing the operation.Append()- Appends text to the end of an existing file, creating the file if it does not exist. Returns aValueTaskthat completes when the write finishes.Copy()- Copies a file from one path to another. Returns a task representing the operation.Move()- Moves a file from one path to another. Deletes the source file after copying. Returns a task representing the operation.Delete()- Deletes the specified file if it exists. Returns aValueTaskthat completes when the deletion (if any) finishes.Exists()- Checks whether a file exists at the given path.
The package also includes 18 additional operations for more specialized cases.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Soenneker.Extensions.Stream (>= 4.0.141)
- Soenneker.Utils.ExecutionContexts (>= 4.0.37)
- Soenneker.Utils.MemoryStream (>= 4.0.1514)
NuGet packages (31)
Showing the top 5 NuGet packages that depend on Soenneker.Utils.File:
| Package | Downloads |
|---|---|
|
Soenneker.Utils.Json
Serializes, deserializes, validates, formats, and writes JSON with System.Text.Json or Newtonsoft.Json. |
|
|
Soenneker.Git.Util
Asynchronous Git operations, repository discovery, and bounded batch processing using bundled Git distributions. |
|
|
Soenneker.Utils.Dotnet
A utility library for the dotnet executable |
|
|
Soenneker.Google.Credentials
An async thread-safe singleton for Google OAuth credentials |
|
|
Soenneker.GitHub.Repositories.Releases
Creates, retrieves, deletes, uploads, and downloads GitHub releases and assets |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.2242 | 0 | 8/31/2026 |
| 4.0.2241 | 0 | 8/31/2026 |
| 4.0.2240 | 117 | 8/31/2026 |
| 4.0.2239 | 174 | 8/31/2026 |
| 4.0.2238 | 75 | 8/30/2026 |
| 4.0.2237 | 417 | 8/30/2026 |
| 4.0.2235 | 2,875 | 8/30/2026 |
| 4.0.2234 | 2,497 | 8/30/2026 |
| 4.0.2233 | 38 | 8/30/2026 |
| 4.0.2232 | 109 | 8/30/2026 |
| 4.0.2231 | 1,126 | 8/29/2026 |
| 4.0.2230 | 5,843 | 8/29/2026 |
| 4.0.2228 | 65 | 8/29/2026 |
| 4.0.2227 | 255 | 8/29/2026 |
| 4.0.2226 | 24,100 | 8/26/2026 |
| 4.0.2223 | 12,741 | 8/22/2026 |
| 4.0.2222 | 1,045 | 8/22/2026 |
| 4.0.2221 | 2,168 | 8/21/2026 |
| 4.0.2220 | 17,708 | 8/18/2026 |
| 4.0.2219 | 5,508 | 8/18/2026 |
Update dependency Soenneker.Utils.MemoryStream to 4.0.1514 (#3044)