Versions in this module Expand all Collapse all v0 v0.1.1 Jul 27, 2026 Changes in this version + func NewJSON[T any](path string, v *T) error + func ReadJSON[T any](s string, v *T) error + func WriteJSONIfChanged[T any](path string, v *T, force bool) (bool, error) + func WriteJSON[T any](path string, v *T) error v0.1.0 Jul 27, 2026 Changes in this version + const DirPerm + const DirPermPublic + const FilePerm + const FilePermPublic + var DefaultManager = NewFileManager() + var ErrInvalidFilename = errors.New("invalid filename") + var ErrInvalidFilepath = errors.New("invalid filepath") + var ErrPathEmpty = errors.New("path is empty") + var ErrPathNotFound = errors.New("path not found") + func CloseAndRemove(f *os.File) + func CollapseHomeDir(p string) string + func Copy(src, dst string) error + func EnsureExt(s, suffix string) string + func Exists(s string) bool + func ExistsErr(p string) error + func ExpandHomeDir(s string) string + func Find(root, pattern string) ([]string, error) + func FindByExtension(root string, ext ...string) ([]string, error) + func IsDir(path string) bool + func IsEmpty(f string) bool + func IsEmptyPath(path string) (bool, error) + func IsFile(path string) bool + func List(root, pattern string) ([]string, error) + func ListRootFolders(root string, ignore ...string) ([]string, error) + func ListWithExclude(path, fileExt string, exclude ...string) ([]string, error) + func MkdirAll(s ...string) error + func New(path string, existsOK bool) (*os.File, error) + func NewTempFile(prefix, ext string) (*os.File, error) + func NewTempFileWithData(prefix, extension string, d []byte) (*os.File, error) + func NewWithData(path string, data []byte, existsOK bool) (*os.File, error) + func NormalizePath(filename, def string) (string, error) + func PrioritizeFile(files []string, name string) + func Read(path string) ([]byte, error) + func Remove(s string) error + func RemoveAll(s string) error + func RemoveEmptyDirs(root string) error + func RemovePruneEmpty(fname string) error + func SizeBytes(s string) int64 + func SizeFormatted(f string) string + func SizeToHuman(b int64) string + func StripExts(p string) string + type FileManager struct + func NewFileManager() *FileManager + func (fm *FileManager) Abs(path string) (string, error) + func (fm *FileManager) Base(path string) string + func (fm *FileManager) Dir(path string) string + func (fm *FileManager) Exists(path string) bool + func (fm *FileManager) ExistsErr(path string) error + func (fm *FileManager) Ext(path string) string + func (fm *FileManager) Find(root, pattern string) ([]string, error) + func (fm *FileManager) FindWithExclude(path, fileExt string, exclude ...string) ([]string, error) + func (fm *FileManager) IsDir(path string) bool + func (fm *FileManager) IsEmpty(path string) bool + func (fm *FileManager) IsEmptyPath(path string) (bool, error) + func (fm *FileManager) IsFile(path string) bool + func (fm *FileManager) Join(elem ...string) string + func (fm *FileManager) Mkdir(path string) error + func (fm *FileManager) MkdirAll(s ...string) error + func (fm *FileManager) Move(src, dst string) error + func (fm *FileManager) New(path string, existsOK bool) (*os.File, error) + func (fm *FileManager) NewTempFile(prefix, ext string) (*os.File, error) + func (fm *FileManager) Read(path string) ([]byte, error) + func (fm *FileManager) Rm(path string) error + func (fm *FileManager) RmAll(path string) error + func (fm *FileManager) RmEmptyDirs(root string) error + func (fm *FileManager) Size(path string) int64