dupers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 25 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.

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

Index

Examples

Constants

This section is empty.

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 IsArchive

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

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(quiet bool, m *database.Matches) string

Print the results of the database comparisons.

Example
matches := database.Matches{}
matches[database.Filepath(file1)] = database.Bucket(bucket1)
s := Print(true, &matches)
fmt.Print(s)
Output:

../test/bucket1/0vlLaUEvzAWP

Types

type Bucket

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

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

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

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) OpenRead added in v0.0.9

func (i *Config) OpenRead()

OpenRead opens the Bolt database for reading.

func (*Config) OpenWrite added in v0.0.9

func (i *Config) OpenWrite()

OpenWrite opens the Bolt database for reading and writing.

func (*Config) Print

func (c *Config) Print() string

Print the results of a dupe request.

func (*Config) PrintBuckets

func (i *Config) PrintBuckets() string

PrintBuckets returns a list of buckets used by the database.

func (*Config) Remove

func (c *Config) Remove() string

Remove all duplicate files from the source directory.

func (*Config) RemoveAll

func (c *Config) RemoveAll() string

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

func (*Config) SetAllBuckets

func (i *Config) SetAllBuckets()

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

func (*Config) SetBuckets

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

SetBuckets adds the bucket name to a list of buckets.

func (*Config) SetCompares

func (i *Config) SetCompares(name Bucket)

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

func (*Config) SetTimer

func (i *Config) SetTimer()

SetTimer starts a process timer.

func (*Config) SetToCheck

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

func (i *Config) ToCheck() string

ToCheck returns the directory or file to check.

func (*Config) WalkArchiver

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() error

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

Jump to

Keyboard shortcuts

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