FluxFlow.Components.FileSystem 3.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package FluxFlow.Components.FileSystem --version 3.1.2
                    
NuGet\Install-Package FluxFlow.Components.FileSystem -Version 3.1.2
                    
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="FluxFlow.Components.FileSystem" Version="3.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FluxFlow.Components.FileSystem" Version="3.1.2" />
                    
Directory.Packages.props
<PackageReference Include="FluxFlow.Components.FileSystem" />
                    
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 FluxFlow.Components.FileSystem --version 3.1.2
                    
#r "nuget: FluxFlow.Components.FileSystem, 3.1.2"
                    
#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 FluxFlow.Components.FileSystem@3.1.2
                    
#: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=FluxFlow.Components.FileSystem&version=3.1.2
                    
Install as a Cake Addin
#tool nuget:?package=FluxFlow.Components.FileSystem&version=3.1.2
                    
Install as a Cake Tool

FluxFlow.Components.FileSystem

Standalone file system nodes for FluxFlow, built on FluxFlow.Nodes. Every node is a self-contained TPL Dataflow processor — new it up and LinkTo the next node. No engine, registry, or runtime required. Every message travels as a FlowMessage<T> envelope, so a correlation id flows from a request to its result without any node copying it by hand.

Nodes

Node Kind Shape Purpose
FileReadNode transform Input (FileReadRequest) → Output (FileReadResult) Reads file content as text or bytes and emits a read result.
FileWriteNode transform Input (FileWriteRequest) → Output (FileWriteResult) Writes request content to a file and emits a write result.
DirectoryEnumerateNode source Output (DirectoryEnumerateEntry) Enumerates files and/or directories from a configured directory, then completes.
FileWatchNode source Output (FileWatchEvent) Emits file system change events from a watched directory until stopped.

The transforms (FileReadNode / FileWriteNode) accept a FlowMessage<TRequest> on Input and broadcast a FlowMessage<TResult> on Output carrying the same correlation id. The sources (DirectoryEnumerateNode / FileWatchNode) begin producing once StartAsync is called and mint a fresh correlation id per emitted item.

Every node also exposes broadcast Errors (FlowError) and Events (FlowEvent) ports. Domain failures surface on Errors (carrying the in-flight correlation id for transforms) and do not stop later messages from being processed; transforms emit a success/failure note on Events, and the sources emit started/entry/changed/completed notes there too.

Construction

Each node takes its options and an optional TimeProvider (used for all result and event timestamps) directly:

await using var read = new FileReadNode(new FileReadOptions { BaseDirectory = "data" });
await using var write = new FileWriteNode(new FileWriteOptions { BaseDirectory = "data" });
await using var enumerate = new DirectoryEnumerateNode(new DirectoryEnumerateOptions
{
    Directory = "inbox",
    BaseDirectory = "data"
});
await using var watch = new FileWatchNode(new FileWatchOptions
{
    Directory = "inbox",
    BaseDirectory = "data"
});

Pass a Microsoft.Extensions.Time.Testing.FakeTimeProvider (or any TimeProvider) as the second argument to make timestamps deterministic in tests.

Options validate at construction. Invalid capacities, size limits, default encodings, source directories, filters, entry-type settings, and watcher buffer settings fail fast with the corresponding node option name, while path policy failures remain runtime diagnostics on each node's Errors port.

BoundedCapacity configures transform input capacity for read/write nodes and source output capacity for directory enumeration and file watching. Directory enumeration awaits output delivery; file watching keeps nonblocking watcher callbacks and reports a FlowError if the bounded source output is not accepting events.

Read / Write transforms

await read.Input.SendAsync(FlowMessage.Create(new FileReadRequest
{
    Path = "logs/output.txt",
    ReadAs = FileReadMode.Text
}));
var result = await read.Output.ReceiveAsync(); // FlowMessage<FileReadResult>

Use ReadAs = FileReadMode.Bytes for raw bytes. Text reads use the request Encoding when provided, otherwise the option DefaultEncoding.

await write.Input.SendAsync(FlowMessage.Create(new FileWriteRequest
{
    Path = "logs/output.txt",
    Content = "hello",
    Mode = FileWriteMode.Overwrite,
    CreateDirectories = true
}));

Bytes can be used instead of Content. When both are set, Bytes wins. Supported write modes are Overwrite, Append, and CreateNew; supported read modes are Text and Bytes.

Watch source

var watch = new FileWatchNode(new FileWatchOptions
{
    Directory = "inbox",
    Filter = "*.json",
    IncludeSubdirectories = false,
    NotifyFilters = ["FileName", "LastWrite", "Size"],
    BaseDirectory = "data",
    InternalBufferSize = 8192,
    BoundedCapacity = 128
});
await watch.StartAsync();
// watch.Output emits FlowMessage<FileWatchEvent> per change; watch.Complete() stops it.

FileWatchEvent carries the changed path, directory, name, change type, and old path/name for rename events. InternalBufferSize optionally sets the underlying watcher buffer and must be between 4096 and 65536 bytes when set.

Directory enumerate source

var enumerate = new DirectoryEnumerateNode(new DirectoryEnumerateOptions
{
    Directory = "inbox",
    Filter = "*.json",
    IncludeSubdirectories = true,
    IncludeFiles = true,
    IncludeDirectories = false,
    MaxEntries = 1000,
    BaseDirectory = "data",
    BoundedCapacity = 128
});
await enumerate.StartAsync();
// enumerate.Output emits FlowMessage<DirectoryEnumerateEntry>, then completes.

DirectoryEnumerateEntry carries the resolved path, source directory, name, entry type, optional byte length, timestamps, and file attributes.

Path resolution

Relative paths are resolved under BaseDirectory when it is set. Relative paths that escape the base directory are rejected. Absolute paths are rejected unless AllowAbsolutePaths is true. When BaseDirectory is not set and AllowAbsolutePaths is false, the current working directory is the implicit base and relative paths that escape it are rejected.

FileReadOptions.MaxBytes defaults to 16777216 (16 MiB). Set it higher for larger files, or set it explicitly to null to keep unlimited reads.

Composition

Building a workflow, reading config, creating nodes, and linking them is a separate concern from the node package. This package is just the standalone nodes.

Use FluxFlow.Components.FileSystem.Composition when a FluxFlow.Composition host should register optional file-system factories:

services
    .AddFluxFlowComposition(configuration)
    .RegisterNodes(registry => registry
        .RegisterFileRead()
        .RegisterFileWrite()
        .RegisterDirectoryEnumerate()
        .RegisterFileWatch());

The composition adapter binds existing FileSystem option records from node configuration and can resolve an optional host-owned keyed TimeProvider resource named clock. Base-directory and absolute-path behavior remain normal node options; the adapter does not add a separate path-resource or sandbox model, and it does not own file-system policy outside those options.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FluxFlow.Components.FileSystem:

Package Downloads
FluxFlow.Components.FileSystem.Composition

FluxFlow.Composition registration and Designer metadata for typed file-system transforms and sources over host-owned keyed clocks.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.0.0-rc.1 65 9/5/2026
6.0.1 154 8/3/2026
3.1.2 128 7/3/2026
3.1.1 164 7/2/2026
3.0.0 115 6/19/2026
2.0.0 134 6/18/2026
1.2.0 419 6/12/2026
1.1.0 115 6/5/2026
1.0.0 114 6/4/2026
0.5.0-alpha.1 245 6/2/2026
0.4.2-alpha.1 76 6/2/2026
0.4.1-alpha.1 73 6/2/2026
0.4.0-alpha.1 113 6/1/2026
0.3.0-alpha.1 70 6/1/2026
0.2.0-alpha.1 65 6/1/2026
0.1.0-alpha.1 79 6/1/2026

Adds the shared FluxFlow package icon. No source, API, or dependency changes.