fileutils

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile added in v0.8.0

func CopyFile(src, dst string) (err error)

CopyFile copies the contents of a file to another file. If the destination file already exists, it will be overwritten.

func ReadFileIfExists added in v0.8.0

func ReadFileIfExists(filePath string) (contents string, exists bool, err error)

ReadFileIfExists reads the contents of a file and returns it as a string, along with a boolean indicating if the file exists. If the file does not exist, it returns an empty string, false and no error. If the file exists but cannot be read, it returns an error.

func WriteToFile

func WriteToFile(outputFileName, content string) (err error)

WriteToFile writes the given content to a file. If the file already exists, it will be overwritten.

Types

This section is empty.

Jump to

Keyboard shortcuts

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