FileSnap 1.0.2
See the version list below for details.
dotnet add package FileSnap --version 1.0.2
NuGet\Install-Package FileSnap -Version 1.0.2
<PackageReference Include="FileSnap" Version="1.0.2" />
paket add FileSnap --version 1.0.2
#r "nuget: FileSnap, 1.0.2"
// Install FileSnap as a Cake Addin #addin nuget:?package=FileSnap&version=1.0.2 // Install FileSnap as a Cake Tool #tool nuget:?package=FileSnap&version=1.0.2
FileSnap
FileSnap is a .NET library designed to capture, compare, and restore file system snapshots. It allows you to take snapshots of a file system at a given point in time, record file and directory states (including metadata such as file sizes, timestamps, and attributes), compare different snapshots to identify changes (new, modified, or deleted files), and restore file system states to a previous snapshot. This library is useful for scenarios such as backup, security, auditing, file integrity monitoring, and implementing versioned file systems or system restore capabilities.
Features
- Capture Snapshots: Record the state of files and directories, including metadata and content.
- Compare Snapshots: Identify changes between snapshots, including new, modified, and deleted files.
- Restore Snapshots: Restore file system states to a previous snapshot, including file content and metadata.
- Optimized Storage: Uses compression to minimize storage space for snapshots.
- Cross-Platform: Compatible with Windows, macOS, and Linux.
Installation
To install FileSnap, add the following package to your .NET project:
dotnet add package FileSnap
Usage
Capturing a Snapshot
using FileSnap.Core.Services;
var snapshotService = new SnapshotService(new HashingService());
var snapshot = await snapshotService.CaptureSnapshotAsync("path/to/directory");
await snapshotService.SaveSnapshotAsync(snapshot, "path/to/save/snapshot.fsnap");
Loading and Comparing Snapshots
var snapshotService = new SnapshotService(new HashingService());
var beforeSnapshot = await snapshotService.LoadSnapshotAsync("path/to/before/snapshot.fsnap");
var afterSnapshot = await snapshotService.LoadSnapshotAsync("path/to/after/snapshot.fsnap");
var comparisonService = new ComparisonService();
var differences = comparisonService.Compare(beforeSnapshot, afterSnapshot);
Restoring a Snapshot
var snapshotService = new SnapshotService(new HashingService());
var snapshot = await snapshotService.LoadSnapshotAsync("path/to/snapshot.fsnap");
var restorationService = new RestorationService();
await restorationService.RestoreSnapshotAsync(snapshot, "path/to/restore/directory");
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. |
-
net9.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.