files

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package files finds and displays files on disk

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfirmClean

func ConfirmClean(confirm bool, fs Files) error

func ConfirmRestore

func ConfirmRestore(confirm bool, fs Files) error

func ConfirmTrash

func ConfirmTrash(confirm bool, fs Files, trashDir string) error

func Remove

func Remove(files Files) (removed int, err error)

func Restore

func Restore(files Files) (restored int, err error)

func SortByExtension

func SortByExtension(a, b File) int

func SortByExtensionReverse

func SortByExtensionReverse(a, b File) int

func SortByModified

func SortByModified(a, b File) int

func SortByModifiedReverse

func SortByModifiedReverse(a, b File) int

func SortByName

func SortByName(a, b File) int

func SortByNameReverse

func SortByNameReverse(a, b File) int

func SortByPath

func SortByPath(a, b File) int

func SortByPathReverse

func SortByPathReverse(a, b File) int

func SortBySize

func SortBySize(a, b File) int

func SortBySizeReverse

func SortBySizeReverse(a, b File) int

func SortDirectoriesFirst

func SortDirectoriesFirst(a, b File) int

func SortDirectoriesLast

func SortDirectoriesLast(a, b File) int

func TrashFile

func TrashFile(trashDir, name string) error

func TrashFiles

func TrashFiles(trashDir string, files ...string) (trashed int)

Types

type DiskFile

type DiskFile struct {
	// contains filtered or unexported fields
}

func NewDisk

func NewDisk(path string) (DiskFile, error)

func (DiskFile) Date

func (f DiskFile) Date() time.Time

func (DiskFile) Filesize

func (f DiskFile) Filesize() int64

func (DiskFile) IsDir

func (f DiskFile) IsDir() bool

func (DiskFile) Mode

func (f DiskFile) Mode() fs.FileMode

func (DiskFile) Name

func (f DiskFile) Name() string

func (DiskFile) Path

func (f DiskFile) Path() string

func (DiskFile) String

func (f DiskFile) String() string

type File

type File interface {
	Name() string
	Path() string
	Date() time.Time
	Filesize() int64
	IsDir() bool
	Mode() fs.FileMode
	String() string
}

type Files

type Files []File

func FindDisk

func FindDisk(dir string, recursive bool, fltr *filter.Filter) (Files, error)

func FindTrash

func FindTrash(trashdir, ogdir string, fltr *filter.Filter) (Files, error)

type TrashInfo

type TrashInfo struct {
	// contains filtered or unexported fields
}

func (TrashInfo) Date

func (t TrashInfo) Date() time.Time

func (TrashInfo) Filesize

func (t TrashInfo) Filesize() int64

func (TrashInfo) IsDir

func (t TrashInfo) IsDir() bool

func (TrashInfo) Mode

func (t TrashInfo) Mode() fs.FileMode

func (TrashInfo) Name

func (t TrashInfo) Name() string

func (TrashInfo) Path

func (t TrashInfo) Path() string

func (TrashInfo) String

func (t TrashInfo) String() string

func (TrashInfo) TrashInfo

func (t TrashInfo) TrashInfo() string

func (TrashInfo) TrashPath

func (t TrashInfo) TrashPath() string

Jump to

Keyboard shortcuts

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