fsutils

package
v2.10.4 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirSize

func DirSize(fs v1.FS, path string) (int64, error)

DirSize returns the accumulated size of all files in folder

func Exists

func Exists(fs v1.FS, path string) (bool, error)

Check if a file or directory exists.

func IsDir

func IsDir(fs v1.FS, path string) (bool, error)

IsDir check if the path is a dir

func MkdirAll

func MkdirAll(fs v1.FS, name string, mode os.FileMode) (err error)

MkdirAll directory and all parents if not existing

func TempDir

func TempDir(fs v1.FS, dir, prefix string) (name string, err error)

TempDir creates a temp dir in the virtual fs Took from afero.FS code and adapted

func TempFile

func TempFile(fs v1.FS, dir, pattern string) (f *os.File, err error)

TempFile creates a temp file in the virtual fs Took from afero.FS code and adapted

func WalkDirFs

func WalkDirFs(fs v1.FS, root string, fn fs.WalkDirFunc) error

WalkDirFs is the same as filepath.WalkDir but accepts a v1.Fs so it can be run on any v1.Fs type

Types

This section is empty.

Jump to

Keyboard shortcuts

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