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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Franz.Common.IO" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.IO" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Franz.Common.IO" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Franz.Common.IO --version 3.0.0
                    
#r "nuget: Franz.Common.IO, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Franz.Common.IO@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Franz.Common.IO&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.IO&version=3.0.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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
Loading failed