gdupes

package
v0.0.0-...-a758588 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION = "0.1.0"

Variables

This section is empty.

Functions

func HumanizeSize

func HumanizeSize(n float64) string

HumanizeSize returns human readable representation of size in bytes

func PopulateFiles

func PopulateFiles(c *Config, filesToProcess chan<- string, directories []string,
	wg *sync.WaitGroup)

PopulateFiles recurses through the list of directories adding files to be processed

func ProcessFiles

func ProcessFiles(c *Config, filesToProcess <-chan string,
	fileHashes map[string]FileMetaSlice,
	lock *sync.Mutex, wg *sync.WaitGroup)

ProcessFiles computes hashes and updates map of hashes for files to be processed

func Run

func Run(c *Config, args []string) ([][]string, error)

Run orchestrates gdupes execution

Types

type Config

type Config struct {
	Directories  []string
	Recurse      bool
	Symlinks     bool
	Hardlinks    bool
	NoEmpty      bool
	NoHidden     bool
	Sameline     bool
	Size         bool
	Summarize    bool
	Quiet        bool
	PrintVersion bool
	NumWorkers   int
	Writer       io.Writer
}

Config structure to store

type FileMeta

type FileMeta struct {
	Path string
	Info os.FileInfo
}

FileMeta struct represents metadata for a file

type FileMetaSlice

type FileMetaSlice []FileMeta

FileMetaSlice represents a FileMeta slice

func (FileMetaSlice) ContainsInode

func (f FileMetaSlice) ContainsInode(fm FileMeta) (bool, int, error)

ContainsInode checks if the inode pointed to by the FileMeta is already contained in the FiletMetaSlice

func (FileMetaSlice) GetFilenames

func (f FileMetaSlice) GetFilenames() []string

GetFilenames returns the list of filenames

Jump to

Keyboard shortcuts

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