Documentation
¶
Overview ¶
Package fileopt provides small filesystem read, write, and creation helpers.
Index ¶
- func DirExistOrCreate(dirPath string) error
- func FileGetContents(filename string) ([]byte, error)
- func FilePutContents[DType string | []byte](filename string, data DType, isAppend ...bool) error
- func GetContents(filename string) ([]byte, error)
- func IsExist(path string) bool
- func IsExistOrCreate[T string | []byte](path string, init ...T) error
- func PutContents[DType string | []byte](filename string, data DType, isAppend ...bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirExistOrCreate ¶
DirExistOrCreate creates dirPath and parent directories when they are missing.
func FileGetContents ¶
FileGetContents reads filename and returns its contents.
func FilePutContents ¶
FilePutContents writes data to filename, creating parent directories as needed.
func GetContents ¶
GetContents reads filename and returns its contents.
func IsExistOrCreate ¶
IsExistOrCreate creates path with optional initial content when it is missing.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.