folder

package
v0.0.1-20230203-0002 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(path string) error

func Exists

func Exists(path string) bool

func MkDir

func MkDir(path string) bool

func MkDirErr

func MkDirErr(path string, perm ...os.FileMode) error

func ScanAndClean

func ScanAndClean(
	path string,
	maxNrOfItems int,
	onDelete func(item fs.FileInfo, itemPath string),
	onScan func(item fs.FileInfo, itemPath string),
	onFinish func(result ScanAndCleanResult),
) error

ScanAndClean -> will scan the folder for items, and it will check if there are multiple files in it.... if there are more than maxNrOfItems then it will delete them by scanned order...

Types

type ScanAndCleanResult

type ScanAndCleanResult struct {
	NrOfDeletedItems   int
	NrOfUndeletedItems int
	DeletedItems       []string
	UndeletedItems     []string
}

Jump to

Keyboard shortcuts

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