Bathos.Platform.Linux 1.0.0

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

Native platform abstractions for .NET

NuGet Native validation

Bathos-written libraries that give .NET applications common interfaces for native OS operations: publish files atomically, inspect file entries, reveal files in Finder or Explorer, open documents in a selected application, and pick a screen color.

The Bathos.Platform packages keep platform-specific interop behind focused capability interfaces, so application code can use native behavior without implementing each OS integration itself. Choose the Windows, macOS, or experimental Linux providers your application needs, with explicit support differences.

Your application supplies its UI toolkit, composition or DI setup, application targets, and native dispatcher. The libraries have no UI-toolkit, DI-container, or image-processing dependencies.

.NET 10 · MIT license. Public APIs follow Semantic Versioning. Linux support is experimental.

Packages

Install the providers your application needs. Each provider brings the core package transitively and references only the core and .NET runtime; sibling providers are optional.

NuGet package What it provides
Bathos.Platform Capability interfaces, explicit OS/provider selection, application targets, and staged file publication with collision-safe naming. Requires a native rename provider for publication.
Bathos.Platform.Windows Native file rename/replacement and inspection, Explorer reveal, executable handoff, App Paths lookup, and an optional GDI screen sampler.
Bathos.Platform.MacOS Native file rename/replacement and inspection, Finder reveal, executable/bundle handoff, LaunchServices lookup, and an optional AppKit screen sampler.
Bathos.Platform.Linux Experimental statx inspection, file-manager reveal, executable/desktop-entry handoff, GIO lookup, and an optional portal screen sampler. Native rename and file publication are unavailable.

Each package contains a net10.0 library, XML API documentation, this README, and MIT license text. Portable PDB symbols are published separately as .snupkg files. The engineering harnesses and test applications are not shipped. Native OS frameworks and Linux system libraries are used from the host rather than bundled in the packages.

Get started

For an application targeting Windows and macOS, install the latest stable packages:

dotnet add package Bathos.Platform.Windows
dotnet add package Bathos.Platform.MacOS

Add --prerelease to include prerelease builds.

This console example writes a complete file to private staging, then publishes it under the first available name:

using Bathos.Platform;
using Bathos.Platform.Files;
using Bathos.Platform.MacOS;
using Bathos.Platform.Windows;

var platform = PlatformProviders.SelectCurrent(new WindowsPlatformProvider(), new MacOSPlatformProvider());
var rename = platform.FileRename ?? throw new PlatformNotSupportedException("Native publication is unavailable.");
await using var publication = new FilePublication(Path.GetFullPath("published-files"), rename);
await publication.Stream.WriteAsync("Hello from .NET!\n"u8.ToArray());
var path = await publication.PublishAsync(new GeneratedFileName("Greeting", ".txt"), CancellationToken.None);
Console.WriteLine(path); // Greeting.txt, Greeting (2).txt, ...; existing files are preserved.

Disposal removes abandoned staging; a published file survives disposal. PublishExactAsync supports an exact filename and explicitly authorized replacement. Publication uses a native rename without a cross-volume copy fallback. Atomic visibility does not guarantee survival of a power failure.

Desktop integration

platform.FileRevealer.RevealAsync(path) selects a file or directory in its containing folder. platform.FileInvoker.OpenAsync(path, target) hands a file to an application selected by the host. Both use absolute paths and keep file ownership with the caller. A successful handoff means submission, not that the document has loaded or the application has focus.

Targets can be an absolute executable path, a macOS .app bundle, or a Linux desktop-entry ID. Focused native lookup helpers support Windows App Paths, macOS bundle identifiers, and Linux desktop entries. The host chooses the target; no product-specific rules or file-association changes are imposed.

Screen sampling is optional. On Windows and macOS, supply an INativeDispatcher backed by your existing native UI loop. On Linux, opt in to the desktop portal sampler. Samples are opaque eight-bit RGB for basic color selection; display-profile accuracy and consistent HDR behavior are outside the contract.

A null capability means unsupported or unconfigured; a null screen sample means user cancellation. Operation failures remain distinct and are reported to the caller. OS detection alone does not establish native-service or permission availability.

Use the provider facade when composing your application, then pass focused capability interfaces to the components that use them. Those interfaces support substitution and test doubles.

Support and documentation

Repository documentation describes current development. For the version you installed, use the XML API documentation shipped with the assemblies and the corresponding source tag listed in releases.

Stable releases preserve public API contracts for callers and implementers within a major version. Minor releases can add optional capabilities; breaking contract changes require a new major version. Linux native support remains experimental; public API compatibility still applies. See the manual test guide for native desktop checks.

For source development, install the SDK pinned in global.json and run task check. Task is optional; the contribution guide includes the equivalent SDK commands.

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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 206 11/9/2026
1.2.0-rc.1 57 11/9/2026
1.2.0-beta.1 60 11/9/2026
1.1.0 247 10/25/2026
1.1.0-rc.1 78 10/25/2026
1.1.0-beta.2 74 10/25/2026
1.1.0-beta.1 70 10/24/2026
1.0.0 212 10/23/2026
0.1.0-beta.1 82 10/22/2026