dupers

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package dupers is the blazing-fast file duplicate checker and filename search.

Package dupers is the blazing-fast file duplicate checker and filename search.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPath    = errors.New("path does not exist")
	ErrPathExist = errors.New("path exists in the database bucket")
)

Functions

func IsArchive added in v0.0.4

func IsArchive(name string) (result bool, mime string, err error)

IsArchive returns true if the read named file is compressed using a supported archive format.

func IsExtension added in v0.0.4

func IsExtension(name string) (result bool, mime string)

IsExtension returns true if the named file extension matches a supported archive format.

func Print

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

Print the results of the database comparisons.

Types

type Bucket added in v0.0.4

type Bucket string

type Config

type Config struct {
	Debug bool // spam the feedback sent to stdout
	Quiet bool // reduce the feedback sent to stdout
	Test  bool // internal unit test mode
	// contains filtered or unexported fields
}

Config options for duper.

func (*Config) Buckets

func (i *Config) Buckets() []Bucket

Buckets returns a slice of Buckets.

func (*Config) CheckPaths added in v0.0.6

func (c *Config) CheckPaths() (ok bool, checkCnt, bucketCnt int)

CheckPaths counts the files in the directory to check and the buckets.

func (*Config) Clean added in v0.0.4

func (c *Config) Clean()

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

func (*Config) OpenDB added in v0.0.4

func (i *Config) OpenDB()

OpenDB opens the Bold database.

func (*Config) Print

func (c *Config) Print()

Print the results of a dupe request.

func (*Config) PrintBuckets added in v0.0.4

func (i *Config) PrintBuckets() string

PrintBuckets returns a list of buckets used by the database.

func (*Config) Remove added in v0.0.3

func (c *Config) Remove()

Remove all duplicate files from the source directory.

func (*Config) RemoveAll added in v0.0.4

func (c *Config) RemoveAll(clean bool)

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

func (*Config) Seek

func (c *Config) Seek()

Seek sources from the database and print out the matches.

func (*Config) SetAllBuckets added in v0.0.4

func (i *Config) SetAllBuckets()

SetAllBuckets sets all the database backets for use with the dupe or search.

func (*Config) SetBuckets added in v0.0.4

func (i *Config) SetBuckets(names ...string)

SetBuckets adds the bucket name to a list of buckets.

func (*Config) SetCompares added in v0.0.4

func (i *Config) SetCompares(name Bucket)

SetCompares fetches items from the named bucket and sets them to c.compare.

func (*Config) SetTimer added in v0.0.4

func (i *Config) SetTimer()

SetTimer starts a process timer.

func (*Config) SetToCheck added in v0.0.4

func (i *Config) SetToCheck(name string)

SetToCheck sets the named string as the directory or file to check.

func (*Config) Status

func (c *Config) Status() string

Status summarizes the file total and time taken.

func (*Config) Timer

func (i *Config) Timer() time.Duration

Timer returns the time taken since the process timer was instigated.

func (*Config) ToCheck added in v0.0.4

func (i *Config) ToCheck() string

ToCheck returns the directory or file to check.

func (*Config) WalkArchiver added in v0.0.4

func (c *Config) WalkArchiver(name 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 Bucket) error

WalkDir walks the named bucket directory for any new files and saves their checksums to the bucket.

func (*Config) WalkDirs

func (c *Config) WalkDirs()

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

func (*Config) WalkSource

func (c *Config) WalkSource()

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

Directories

Path Synopsis
Package database interacts with Dupers bbolt database and buckets.
Package database interacts with Dupers bbolt database and buckets.

Jump to

Keyboard shortcuts

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