mirror of
https://github.com/elmindreda/duff.git
synced 2026-03-02 18:23:36 +01:00
77 lines
2.2 KiB
Plaintext
77 lines
2.2 KiB
Plaintext
Brief hacking guide to duff
|
|
===========================
|
|
|
|
Basic nomenclature
|
|
==================
|
|
|
|
File n.
|
|
A file, specified on the command line or found via directory recursion,
|
|
included in the set of files checked for duplicates.
|
|
|
|
Cluster n.
|
|
A collection of files with equal contents, i.e. duplicates.
|
|
|
|
Directory n.
|
|
A physical directory (inode, not link) which has been searched for files.
|
|
|
|
Function n.
|
|
A specific message digest function.
|
|
|
|
Invalid a.
|
|
A file becomes invalid if any stage of data gathering failed on it. An
|
|
invalid file should not be modified or operated upon.
|
|
|
|
|
|
Important files
|
|
===============
|
|
|
|
duff.c
|
|
Program main, information printing and option handling.
|
|
|
|
duffdriver.c
|
|
Primary program logic; file collection and cluster reporting.
|
|
|
|
dufffile.c
|
|
Functions for working with files.
|
|
|
|
duffstring.c duffstring.h
|
|
Replacement implementations of various libc string functions.
|
|
|
|
duffutil.c
|
|
Error reporting, digest selection and various other utility functions.
|
|
|
|
duff.h
|
|
Main header file.
|
|
|
|
sha1.c sha1.h sha256.c sha256.h sha384.c sha384.h sha512.c sha512.h
|
|
Implements SHA family message digest calculation.
|
|
|
|
|
|
Important functions
|
|
===================
|
|
|
|
dufffile.c: compare_files()
|
|
The main comparison function for files. Start here if you wish to modify the
|
|
comparison algorithm.
|
|
|
|
dufffile.c: compare_file_*() and get_file_*()
|
|
Calculates and compares various file attributes, respectively. Start here if
|
|
you wish to modify one of the existing comparison methods.
|
|
|
|
duffdriver.c: process_args()
|
|
The main driver function. Contains nearly everything except flag parsing.
|
|
Start here if you wish to modify overall program flow.
|
|
|
|
duffdriver.c: process_path(), process_file() and process_directory()
|
|
The main functions for collecting files. Start here if you wish to modify the
|
|
traversal algorithm.
|
|
|
|
duffdriver.c: process_clusters()
|
|
Finds and reports the clusters of duplicates in the list of files. Start here
|
|
if you wish to optimise list traversal or alter program output.
|
|
|
|
duffdriver.c: has_recorded_directory() and record_directory()
|
|
Records traversed directories (in a very primitive way). Start here if you
|
|
wish to modify the directory loop detection algorithm.
|
|
|