Conesoft.Files 1.8.2

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

// Install Conesoft.Files as a Cake Tool
#tool nuget:?package=Conesoft.Files&version=1.8.2

Conesoft.Files

publish to nuget

NuGet version (Conesoft.Files) https://www.nuget.org/packages/Conesoft.Files/

tiny example

adapted from realworld use

var logfile = Directory.From("SomeRoot") / "Scheduler" / Filename.From(DateTime.Today.ToShortDateString(), "md");

await logfile.AppendText($"- **{task.GetType().Name}** *executed* ");

instead of

var logPath = System.IO.Path.Combine("SomeRoot", "Scheduler", $"{DateTime.Today.ToShortDateString()}.md");
await System.IO.File.AppendAllTextAsync(logPath, $"- **{task.GetType().Name}** *executed* ");

reading/writing objects

var data = await File.From("some\path.json").ReadFromJson<SomeType>();

File.From("some\other path.json").WriteAsJson(data);

temporary directories

{
    using var temp = Directory.Common.Temporary();
    
    await (temp / Filename.From("some temporary", "tmp")).WriteBytes(somebytes);
    
    // temporary directory gets deleted when out of scope
}

watching a folder

void PrettyPrint(string title, File[] files)
{
    if(files.Length > 0)
    {
        Console.WriteLine($"{title} ({files.Length})");
        foreach(var file in files)
        {
            Console.WriteLine(file);
        }
        Console.WriteLine();
    }
}

await foreach(var files in Directory.From("some\path"))
{
    PrettyPrint("ALL FILES", files.All);
    PrettyPrint("ADDED FILES", files.Added);
    PrettyPrint("CHANGED FILES", files.Changed);
    PrettyPrint("DELETED FILES", files.Deleted);
}
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Conesoft.Files:

Package Downloads
Conesoft.Users

little library allowing simple cookie based user authentication without a backing database

Conesoft.Hosting

default settings for locally hosted aspnet pages

Conesoft.DomainAreas

ASP.NET Core request Rewriter, allowing Areas to be accessed as domains

Conesoft.LetsEncrypt

Letsencrypt Wildcard Generation using Dnsimple

Conesoft.All

meta package for all major Conesoft Nuget libraries

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.8.2 164 8/24/2023
1.8.1 183 7/31/2023
1.8.0 140 7/31/2023
1.7.9 123 7/31/2023
1.7.8 131 7/31/2023
1.7.7 181 7/18/2023
1.7.6 252 4/27/2023
1.7.5 135 4/27/2023
1.7.4 149 4/25/2023
1.7.3 307 1/11/2023
1.7.2 294 1/11/2023
1.7.1 263 12/29/2022
1.7.0 260 1/8/2022
1.6.4 881 7/27/2021
1.6.3 317 7/19/2021
1.6.2 314 7/19/2021
1.6.1 311 7/19/2021
1.6.0 314 7/19/2021
1.5.21 666 7/4/2021
1.5.20 337 7/4/2021
1.5.18 356 7/4/2021
1.5.17 344 7/4/2021
1.5.16 371 7/4/2021
1.5.15 557 6/23/2021
1.5.14 327 6/23/2021
1.5.13 346 6/23/2021
1.5.12 340 6/23/2021
1.5.11 374 6/23/2021
1.5.10 364 6/23/2021
1.5.9 1,498 6/22/2021
1.5.8 448 6/21/2021
1.5.7 375 6/21/2021
1.5.6 342 6/21/2021
1.5.5 327 6/9/2021
1.5.4 343 6/6/2021
1.5.3 563 5/26/2021
1.5.2 376 5/20/2021
1.5.1 361 5/20/2021
1.5.0 337 5/17/2021
1.4.10 380 5/16/2021
1.4.6 415 5/16/2021
1.4.5 422 5/16/2021
1.4.4 386 5/16/2021
1.4.3 361 5/16/2021
1.4.2 516 4/26/2021
1.4.1 343 4/26/2021
1.4.0 363 4/26/2021
1.3.2 668 4/11/2021
1.3.1 729 3/17/2021
1.3.0 311 3/17/2021
1.2.5 321 3/16/2021
1.2.4 318 3/16/2021
1.2.3 337 3/16/2021
1.2.2 331 3/16/2021
1.2.1 346 3/16/2021
1.2.0 382 1/4/2021
1.1.2 2,008 11/9/2020
1.1.1 446 11/9/2020
1.0.15 426 11/9/2020
1.0.14 439 11/9/2020
1.0.13 446 11/9/2020
1.0.12 585 10/9/2020
1.0.11 597 9/10/2020
1.0.10 888 9/8/2020
1.0.9 478 8/30/2020
1.0.8 470 8/5/2020
1.0.7 885 7/19/2020
1.0.6 482 7/19/2020
1.0.5 529 5/2/2020
1.0.4 510 5/2/2020
1.0.3 460 5/2/2020
1.0.2 443 5/2/2020
1.0.1 462 5/2/2020
1.0.0 632 5/2/2020