Documentation ¶
Overview ¶
Package fileoperation provides a set of functions commonly used on files.
Index ¶
- func AppendLines(lines []string, filename string) error
- func AppendWord(src string, dest string, sep string, word string) error
- func Cat(filenames []string, w io.Writer) error
- func CatIO(readers []io.Reader, w io.Writer) error
- func Copy(src string, dest string) error
- func CountLines(filename string) (int, error)
- func FileExists(path string) bool
- func ReadLines(filename string) ([]string, error)
- func WriteLines(lines []string, filename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendLines ¶
AppendLines appends all lines to a text file, creating a new file if it doesn't exist.
func AppendWord ¶
AppendWord appends a separator and a word to each lines present in a text file.
func CountLines ¶
CountLines counts the number of lines in a file.
func FileExists ¶ added in v2.1.0
FileExists returns true if a file exists on disk.
func WriteLines ¶
WriteLines writes all lines to a text file, truncating the file if it already exists.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.