Soenneker.Utils.File
4.0.2232
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Utils.File --version 4.0.2232
NuGet\Install-Package Soenneker.Utils.File -Version 4.0.2232
<PackageReference Include="Soenneker.Utils.File" Version="4.0.2232" />
<PackageVersion Include="Soenneker.Utils.File" Version="4.0.2232" />
<PackageReference Include="Soenneker.Utils.File" />
paket add Soenneker.Utils.File --version 4.0.2232
#r "nuget: Soenneker.Utils.File, 4.0.2232"
#:package Soenneker.Utils.File@4.0.2232
#addin nuget:?package=Soenneker.Utils.File&version=4.0.2232
#tool nuget:?package=Soenneker.Utils.File&version=4.0.2232
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.38)
- Soenneker.Utils.MemoryStream (>= 4.0.1514)
NuGet packages (37)
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.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.2246 | 0 | 9/1/2026 |
| 4.0.2245 | 0 | 8/31/2026 |
| 4.0.2244 | 0 | 8/31/2026 |
| 4.0.2243 | 0 | 8/31/2026 |
| 4.0.2242 | 64 | 8/31/2026 |
| 4.0.2241 | 2,262 | 8/31/2026 |
| 4.0.2240 | 835 | 8/31/2026 |
| 4.0.2239 | 1,888 | 8/31/2026 |
| 4.0.2238 | 88 | 8/30/2026 |
| 4.0.2237 | 1,088 | 8/30/2026 |
| 4.0.2235 | 4,859 | 8/30/2026 |
| 4.0.2234 | 2,925 | 8/30/2026 |
| 4.0.2233 | 49 | 8/30/2026 |
| 4.0.2232 | 127 | 8/30/2026 |
| 4.0.2231 | 1,320 | 8/29/2026 |
| 4.0.2230 | 7,219 | 8/29/2026 |
| 4.0.2228 | 75 | 8/29/2026 |
| 4.0.2227 | 275 | 8/29/2026 |
| 4.0.2226 | 28,146 | 8/26/2026 |
| 4.0.2223 | 12,882 | 8/22/2026 |
Update dependency Soenneker.Utils.ExecutionContexts to 4.0.38 (#3038)