PathsSynchronizer.sln
├── PathsSynchronizer/ # Core library (namespaces: PathsSynchronizer)
├── PathsSynchronizer.Hashing.XXHash/# XXHash IHashProvider implementation
├── PathsSynchronizer.MurmurHash/ # MurmurHash IHashProvider (incomplete – see below)
├── PathsSyncronizer.Console/ # CLI entrypoint ← note the typo: Syncronizer
└── PathsSyncronizer.Test/ # xUnit tests ← same typo
Naming quirk: folders/projects use Syncronizer (one 'h'), but all namespaces are PathsSynchronizer. Do not "fix" the folder names — the .sln and .csproj references depend on them.
All projects target net8.0 with nullable enabled.
# Build everything
dotnet build PathsSynchronizer.sln
# Run all tests
dotnet test PathsSyncronizer.Test/PathsSyncronizer.Test.csproj
# Run a single test by name
dotnet test PathsSyncronizer.Test/PathsSyncronizer.Test.csproj --filter "FullyQualifiedName~<TestMethodName>"
# Run the console app
dotnet run --project PathsSyncronizer.Console/PathsSyncronizer.Console.csprojNo global.json — SDK version is whatever is installed locally.
HashServiceuses a producer/consumerChannelwith worker tasks and aSemaphoreSlimfor IO concurrency.- Small files are fully hashed; large files use sampled hashing (
SampleCount,SampleBlockSize,FullHashThreshold). - Built-in
ServiceOptionspresets:SSDandExternalHDD.
- Small files are fully hashed; large files use sampled hashing (
StorageServiceserializesDirectoryHashas JSON, then GZip-compresses it. Output files use.datextension.GZipHelperis internal; useStorageServiceas the public persistence API.- Console app: prompts for a path, scans it, saves
directoryhash_yyyyMMddHHmmss.datin the current working directory.
| Type | Equals compares |
|---|---|
DirectoryHash |
path and file sequence |
FileHash |
hashes only, not path |
DataHash |
byte sequence |
Hash |
hex-string view of DataHash |
JsonConstructor attributes are present so JSON round-trips work with records — don't remove them.
MurmurHashProvider.ComputeHashcomputes a value but returnsnew DataHash([12])— it is a stub/buggy implementation. Do not rely on it for correctness.
- Several tests hardcode absolute local paths (
C:\Users\...,E:\Foto, etc.) — they are not portable and will fail on any machine without those exact paths. - Some tests write artifacts to disk (
scan.dat,missing.txt,duplicates.json) in the working directory. - No CI is configured; tests are run manually.