Skip to content

decuser/dex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dex - directory examine

A Go port of dircmp, rearchitected around clean data structures.

Usage

dex [options] <dir>           # find duplicates in a directory
dex [options] <src> <dst>     # compare two directories

Options

-a    include hidden files
-r    recurse subdirectories
-f    fast digest (samples large files instead of full hash)
-b    brief output (summary only)
-l    show full digests
-d    debug output

Five Buckets (comparison mode)

  1. Exact match — same relative path, same content
  2. Modified — same relative path, different content
  3. Same content, different path — content exists in both trees at different locations
  4. Only in src — no path match, no content match in dst
  5. Only in dst — no path match, no content match in src

Building

make            # build for current platform
make dist       # build all platforms into dist/
make release    # build and copy to releases/
make clean      # remove build artifacts

Prebuilt binaries are in releases/.

Test Data

The tests/ directory contains src and dst trees for exercising the comparison logic.

To test error handling:

chmod 000 tests/src/broken-perms
./dex -a -r tests/src tests/dst
chmod 644 tests/src/broken-perms

Lineage

Ported from dircmp.py, rewritten with explicit data structures (Tree, CompareResult) instead of global state.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published