dupe

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

© Ben Garrett https://github.com/bengarrett/dupers

Index

Constants

View Source
const (
	WinOS = "windows"
)

Variables

View Source
var (
	ErrNoBucket    = errors.New("a named bucket is required")
	ErrPathExist   = errors.New("path exists in the database bucket")
	ErrPathNoFound = errors.New("path does not exist")
)

Functions

func Bucket

func Bucket(s string) parse.Bucket

Bucket returns s as the Bucket type.

func Print

func Print(quiet, exact bool, term string, m *database.Matches) string

Print the results of the database comparisons.

func PrintWalk added in v1.0.1

func PrintWalk(lookup bool, c *Config) string

PrintWalk prints "Scanning/Looking up".

Types

type Config

type Config struct {
	Debug bool // Debug spams technobabble to stdout.
	Quiet bool // Quiet the feedback sent to stdout.
	Test  bool // Test toggles the internal unit test mode.
	parse.Parser
}

Config options.

func (*Config) CheckPaths

func (c *Config) CheckPaths() (ok bool, files, buckets int)

CheckPaths counts the number of files in a directory to check and the number of buckets.

func (*Config) Checksum added in v1.0.1

func (c *Config) Checksum(name, bucket string) error

Checksum the named file and save it to the bucket.

func (*Config) Clean

func (c *Config) Clean() string

Clean removes all empty directories from c.Source. Directories containing hidden system directories or files are not considered empty.

func (*Config) Print

func (c *Config) Print() string

Print the results of a dupe request.

func (*Config) Read added in v1.0.1

func (c *Config) Read(bucket, name, ext string)

Read opens the named archive, hashes and saves the content to the bucket.

func (*Config) Read7Zip added in v1.0.1

func (c *Config) Read7Zip(bucket, name string)

Read7Zip opens the named 7-Zip archive, hashes and saves the content to the bucket.

func (*Config) Remove

func (c *Config) Remove() string

Remove duplicate files from the source directory.

func (*Config) Removes added in v1.0.1

func (c *Config) Removes() string

Removes the directories from the source that do not contain unique MS-DOS or Windows programs.

func (*Config) Status

func (c *Config) Status() string

Status summarizes the file totals and process duration.

func (*Config) WalkArchiver

func (c *Config) WalkArchiver(name parse.Bucket) error

WalkArchiver walks the bucket directory saving the checksums of new files to the database. Any archived files supported by archiver will also have its content hashed. Archives within archives are currently left unwalked.

func (*Config) WalkDir

func (c *Config) WalkDir(name parse.Bucket) error

WalkDir walks the named bucket directory for any new files to add their checksums to the database.

func (*Config) WalkDirs

func (c *Config) WalkDirs()

WalkDirs walks the named bucket directories for any new files to add their checksums to the database.

func (*Config) WalkSource

func (c *Config) WalkSource() error

WalkSource walks the source directory or a file to collect the hashed content for a future comparison.

Directories

Path Synopsis
internal
archive
© Ben Garrett https://github.com/bengarrett/dupers
© Ben Garrett https://github.com/bengarrett/dupers
parse
© Ben Garrett https://github.com/bengarrett/dupers
© Ben Garrett https://github.com/bengarrett/dupers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL