fs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies a file from src to dst. If dst already exists, it will be overwritten.

func CreateDirIfNotExists

func CreateDirIfNotExists(path string) error

CreateDirIfNotExists creates a dir at a specified path if it does not exists

func CreateDirIfNotExistsWithPerm

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

CreateDirIfNotExistsWithPerm creates a dir at a specified path and perm if it does not exists

func DirExists

func DirExists(path string) bool

DirExists Check if the path exists and is a directory

func ListFilesWithExt

func ListFilesWithExt(dir, ext string) ([]string, error)

ListFilesWithExt returns a list of files in the given directory with the specified extension. The extension should include the dot, e.g. ".go"

func PathExists

func PathExists(path string) bool

PathExists checks if a directory or a file exists at the given path

func SafeRemove

func SafeRemove(path string) error

SafeRemove removes a file or directory if it exists, and does nothing if it doesn't exist

Types

This section is empty.

Jump to

Keyboard shortcuts

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