Franz.Common.IO
3.0.0
dotnet add package Franz.Common.IO --version 3.0.0
NuGet\Install-Package Franz.Common.IO -Version 3.0.0
<PackageReference Include="Franz.Common.IO" Version="3.0.0" />
<PackageVersion Include="Franz.Common.IO" Version="3.0.0" />
<PackageReference Include="Franz.Common.IO" />
paket add Franz.Common.IO --version 3.0.0
#r "nuget: Franz.Common.IO, 3.0.0"
#:package Franz.Common.IO@3.0.0
#addin nuget:?package=Franz.Common.IO&version=3.0.0
#tool nuget:?package=Franz.Common.IO&version=3.0.0
Franz.Common.IO
A temporary-file-backed stream that deletes its backing file when disposed.
Overview
A temporary-file-backed stream that deletes its backing file when disposed.
Installation
dotnet add package Franz.Common.IO
DeleteTemporaryFileAfterReadingStream
The package currently exposes DeleteTemporaryFileAfterReadingStream, a FileStream subclass. Its parameterless constructor creates a temporary file using Path.GetTempFileName() and opens it for writing with FileMode.Create.
using Franz.Common.IO;
await using (var temporary = new DeleteTemporaryFileAfterReadingStream())
{
await source.CopyToAsync(temporary);
temporary.Position = 0;
// Consume the temporary stream before leaving this scope.
await temporary.CopyToAsync(destination);
}
// The stream is closed and its backing temporary file is deleted.
Ownership and lifecycle
The stream owns the temporary file it creates. Disposing the stream first closes the underlying FileStream, then deletes the file if it still exists. Dispose it deterministically with using or await using; do not treat the backing path as durable storage.
The type does not wrap an arbitrary caller-provided stream, and it does not delete a source file after reading. It creates and owns its own temporary file.
Operational considerations
- Temporary storage capacity and permissions are environment concerns; ensure the process can create files in the platform temporary directory.
- Temporary files may contain sensitive data. Apply appropriate host-level filesystem protections and avoid logging their contents.
- The implementation deletes the file during synchronous disposal. Handle cleanup failures according to the application's operational policy.
- This is a file-backed stream, not an in-memory buffer; account for disk I/O and temporary storage usage.
License
MIT. See LICENSE.
| 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
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Franz.Common.IO:
| Package | Downloads |
|---|---|
|
Franz.Common.Http.Client
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 96 | 11/10/2026 |
| 2.3.4 | 352 | 11/1/2026 |
| 2.3.3 | 314 | 10/28/2026 |
| 2.3.2 | 113 | 10/27/2026 |
| 2.3.1 | 166 | 10/26/2026 |
| 2.3.0 | 246 | 7/21/2026 |
| 2.2.19 | 157 | 7/19/2026 |
| 2.2.18 | 148 | 7/19/2026 |
| 2.2.17 | 142 | 7/12/2026 |
| 2.2.16 | 150 | 7/2/2026 |
| 2.2.15 | 140 | 6/29/2026 |
| 2.2.14 | 140 | 6/29/2026 |
| 2.2.13 | 138 | 6/29/2026 |
| 2.2.12 | 136 | 6/28/2026 |
| 2.2.11 | 135 | 6/28/2026 |
| 2.2.10 | 136 | 6/28/2026 |
| 2.2.9 | 136 | 6/28/2026 |
| 2.2.8 | 139 | 6/28/2026 |
| 2.2.7 | 143 | 6/7/2026 |
| 2.2.6 | 138 | 6/6/2026 |