package
module
Version:
v0.0.0-...-073d0c7
Opens a new window with list of versions in this module.
Published: Jul 6, 2018
License: BSD-3-Clause, MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
rfile
Read a file in reverse line-by-line.
Inspired by: a gonuts discussion.
Documentation: in godoc.
...
f, err := rfile.Open(file)
if err != nil {
// handle err
}
for {
line, err := f.ReadLine()
if err != nil {
if err != io.EOF {
// handle error
}
break // must be io.EOF
}
// do something with "line"
}
f.Close()
...
Documentation
¶
Package rfile reads a file in reverse - line-by-line.
Tail returns the last N lines of a file. If the file has
fewer lines than 'n', the whole file will be returned.
Rfile manages a file opened for reading line-by-line in reverse.
Open returns Rfile handle to be read in reverse line-by-line.
Close file that was opened.
ReadLine returns the next previous line, beginning with the last line in the file.
When the beginning of the file is reached: "", io.EOF is returned.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.