Skip to content

WayneKoorts/CloudFileStatusManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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.
    • On Windows, any cloud drive implemented with the Cloud Filter API should work.
    • On macOS, the implementation uses NSURL ubiquitous item APIs which are designed for iCloud, but path-based detection is also available for OneDrive.

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.macOS project
    • Produces the CloudFileStatusManager.macOS package (com.wkoorts.CloudFileStatusManager.macOS).
    • Contains the macOS implementation of the ICloudFileStatusManager interface.
  • CloudFileStatusManager.CLI.Common project
    • Contains shared CLI command logic used by both platform-specific CLI applications.
  • CloudFileStatusManager.CLI.Windows project
    • Command-line interface for Windows.
  • CloudFileStatusManager.CLI.macOS project
    • Command-line interface for macOS.

Using the CLI

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

Windows

$ ./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

macOS

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

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.

Donate

Buy Me A Coffee

About

A C# library for managing the hydration status of files on cloud drives like iCloud Drive or OneDrive.

Topics

Resources

License

Stars

Watchers

Forks

Languages