WinSoftFileUtility 1.0.3

.NET 7.0
dotnet add package WinSoftFileUtility --version 1.0.3
NuGet\Install-Package WinSoftFileUtility -Version 1.0.3
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="WinSoftFileUtility" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WinSoftFileUtility --version 1.0.3
#r "nuget: WinSoftFileUtility, 1.0.3"
#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.
// Install WinSoftFileUtility as a Cake Addin
#addin nuget:?package=WinSoftFileUtility&version=1.0.3

// Install WinSoftFileUtility as a Cake Tool
#tool nuget:?package=WinSoftFileUtility&version=1.0.3


A library for displaying file names and retrieving directory content, implemented in a PathInfo class.

.NET 7.0, Windows only. Can only be used if target framework is set to .net7.0-windows.



Install-Package WinSoftFileUtility

Shorten a path:

var max = 15;
var f = new PathInfo(new FileInfo(@"C:\Temp\hello.txt"));

// Result: C:...\hello.txt

Get the size of a file in gigabytes:

var p = new PathInfo(new FileInfo(@"..."));

Get the size of a directory as a readable string:

var p = new PathInfo(new DirectoryInfo(@"..."));

// Result: 52,21 Mb

Retrieve directory contents in two levels:

var l = new PathInfo(new DirectoryInfo(@"C:\")).GetDirectoryContent(2);
foreach (var p in l)

Retrieve directory contents in three levels, if file ending is .ico:

bool Guard(PathInfo p) =>
    p.ContainsDirectory || (p.ContainsFile && p.FullName.EndsWith(".ico", StringComparison.CurrentCultureIgnoreCase));

var l = new PathInfo(new DirectoryInfo(@"C:\")).GetDirectoryContent(3, Guard);
foreach (var p in l)
Product Compatible and additional computed target framework versions.
.NET net7.0-windows7.0 is compatible. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • net7.0-windows7.0

    • No dependencies.

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.0.3 205 3/3/2023
1.0.1 241 12/14/2022
1.0.0 268 10/15/2022

Moved to .NET 7.0 (Windows).