fileutils

package
v0.0.0-...-96daba7 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileSize

func FileSize(fd *os.File) (int64, error)

func OpenOrCreateFd

func OpenOrCreateFd(dirName string) (*os.File, error)

Types

type FileChangeRecord

type FileChangeRecord struct {
	AllCached  mapset.Set     // all cached file
	FileFilter FileFilterFunc //  if cb return true  represents cb digest the file
	// contains filtered or unexported fields
}

this is an file system cache it can be used for listen changes of file in chain specific dir

func NewFileChangeRecord

func NewFileChangeRecord(fileFilter FileFilterFunc) FileChangeRecord

func (*FileChangeRecord) RefreshCache

func (fc *FileChangeRecord) RefreshCache(keyDir string) (creates mapset.Set, deletes mapset.Set, updates mapset.Set, err error)

type FileFilterFunc

type FileFilterFunc func(dir string, file os.FileInfo) bool

Jump to

Keyboard shortcuts

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