Documentation
¶
Overview ¶
Package textfile reads a text file as the file function of expressions and the file action do, and splits text into its lines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrChanged = errors.New("changed while it was opened")
ErrChanged is the error, wrapped, of a path that came to hold another file between being looked at and being opened, as when a log is rotated.
Functions ¶
func CheckRegular ¶
CheckRegular returns an error unless info, of what is at path, is of a regular file.
func Lines ¶
Lines returns the lines of s, without their line endings, \n or \r\n. The end of the last line is not a line of its own, so the lines of a file are those an editor shows, and an empty s has none.
func Read ¶
Read returns the content of the file at path, relative to the working directory, as the paths of actions are. Only a regular file is read, and no more of it than limit bytes: a device such as /dev/zero, or a file that grows while it is read, would otherwise be read on and on. A larger file is an error rather than cut short.
Types ¶
This section is empty.