Soenneker.Utils.File
4.0.2237
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Utils.File --version 4.0.2237
NuGet\Install-Package Soenneker.Utils.File -Version 4.0.2237
<PackageReference Include="Soenneker.Utils.File" Version="4.0.2237" />
<PackageVersion Include="Soenneker.Utils.File" Version="4.0.2237" />
<PackageReference Include="Soenneker.Utils.File" />
paket add Soenneker.Utils.File --version 4.0.2237
#r "nuget: Soenneker.Utils.File, 4.0.2237"
#:package Soenneker.Utils.File@4.0.2237
#addin nuget:?package=Soenneker.Utils.File&version=4.0.2237
#tool nuget:?package=Soenneker.Utils.File&version=4.0.2237
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.146)
- Soenneker.Utils.ExecutionContexts (>= 4.0.38)
- Soenneker.Utils.MemoryStream (>= 4.0.1520)
NuGet packages (36)
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
Loads service-account JSON files from LocalResources and caches Google credentials by ordered OAuth scopes. |
|
|
Soenneker.Utils.File.Download
Provides a flexible utility for downloading files from specified URIs, with thread-safe concurrency and automatic file name conflict handling |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.2254 | 115 | 9/5/2026 |
| 4.0.2253 | 1,422 | 9/4/2026 |
| 4.0.2252 | 3,601 | 9/4/2026 |
| 4.0.2251 | 4,433 | 9/4/2026 |
| 4.0.2250 | 1,839 | 9/4/2026 |
| 4.0.2249 | 138 | 9/4/2026 |
| 4.0.2248 | 7,037 | 9/4/2026 |
| 4.0.2247 | 8,505 | 9/4/2026 |
| 4.0.2246 | 15,175 | 9/1/2026 |
| 4.0.2245 | 902 | 8/31/2026 |
| 4.0.2244 | 84 | 8/31/2026 |
| 4.0.2243 | 1,196 | 8/31/2026 |
| 4.0.2242 | 5,001 | 8/31/2026 |
| 4.0.2241 | 8,352 | 8/31/2026 |
| 4.0.2240 | 2,255 | 8/31/2026 |
| 4.0.2239 | 2,841 | 8/31/2026 |
| 4.0.2238 | 144 | 8/30/2026 |
| 4.0.2237 | 1,440 | 8/30/2026 |
| 4.0.2235 | 7,708 | 8/30/2026 |
| 4.0.2234 | 3,989 | 8/30/2026 |
Update dependency Soenneker.Utils.MemoryStream to 4.0.1520 (#3054)