com.wkoorts.CloudFileStatusManager.Windows 1.1.5

dotnet add package com.wkoorts.CloudFileStatusManager.Windows --version 1.1.5
                    
NuGet\Install-Package com.wkoorts.CloudFileStatusManager.Windows -Version 1.1.5
                    
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="com.wkoorts.CloudFileStatusManager.Windows" Version="1.1.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="com.wkoorts.CloudFileStatusManager.Windows" Version="1.1.5" />
                    
Directory.Packages.props
<PackageReference Include="com.wkoorts.CloudFileStatusManager.Windows" />
                    
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 com.wkoorts.CloudFileStatusManager.Windows --version 1.1.5
                    
#r "nuget: com.wkoorts.CloudFileStatusManager.Windows, 1.1.5"
                    
#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 com.wkoorts.CloudFileStatusManager.Windows@1.1.5
                    
#: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=com.wkoorts.CloudFileStatusManager.Windows&version=1.1.5
                    
Install as a Cake Addin
#tool nuget:?package=com.wkoorts.CloudFileStatusManager.Windows&version=1.1.5
                    
Install as a Cake Tool

Cloud File Status Manager

Description

This is a .NET library and CLI utility for reading & managing the hydration and pin status of files on cloud drives like iCloud Drive or OneDrive.

Packages

  • CloudFileStatusManager
    • Contains the ICloudFileStatusManager interface, and enums for the hydration and pin status of files. This is a cross-platform package and required in all cases.
  • CloudFileStatusManager.Windows
    • Contains the Windows implementation of the ICloudFileStatusManager interface. You also need this one in all cases at the moment because Windows is the only supported platform, but there will be a macOS version in the future.

Features

  • Read the hydration status (whether or not the file has been downloaded locally) of files on cloud drives.
  • Manage the hydration status of files on cloud drives (hydrate or dehydrate files).

Limitations

  • Tested only with iCloud Drive and OneDrive, but may work for other providers. I suspect that any cloud drive which is implemented with the Windows Cloud Filter API will probably work.
  • Initially only supports Windows, but I need a Mac implementation for a project I'm working on, so I'll probably add that soon if it makes sense under the same interfaces.

Project & Package Structure

  • CloudFileStatusManager project
    • Produces the CloudFileStatusManager package (com.wkoorts.CloudFileStatusManager).
    • Contains the ICloudFileStatusManager interface, and enums for the hydration and pin status of files.
  • CloudFileStatusManager.Windows project
    • Produces the CloudFileStatusManager.Windows package (com.wkoorts.CloudFileStatusManager.Windows).
    • Contains the Windows implementation of the ICloudFileStatusManager interface.
  • CloudFileStatusManager.CLI.Windows project
    • This is a command-line interface for CloudFileStatusManager.Windows.
    • Produces no package.

Using the CLI

Binaries for the CLI are available to download from the Releases page.

$ ./cfsm.exe --help
Description:
  Cloud File Status Manager CLI for Windows

Usage:
  cfsm [command] [options]

Options:
  -v, --verbose   Show verbose output
  --version       Show version information
  -?, -h, --help  Show help and usage information

Commands:
  is-on-cloud-storage <file>   Check if a file is on cloud storage
  get-hydration-status <file>  Get the hydration status of a file
  get-pin-status <file>        Get the pin status of a file
  hydrate <file>               Hydrate a file
  dehydrate <file>             Dehydrate a file

Acknowledgements

Thank you to Hunter Ratliff, who explained how file attributes in Windows represent the various states of files on cloud drives in this blog post.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows10.0.19041 is compatible.  net9.0-windows was computed.  net9.0-windows10.0.19041 is compatible.  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.