Documentation
¶
Overview ¶
Package xopen makes it easy to get buffered readers and writers. Ropen opens a (possibly gzipped) file/process/http site for buffered reading. Wopen opens a (possibly gzipped) file for buffered writing. Both will use gzip when appropriate and will user buffered IO.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDirNotSupported = errors.New("xopen: input is a directory")
ErrDirNotSupported means the path is a directory.
var ErrNoContent = errors.New("xopen: no content")
ErrNoContent means nothing in the stream/file.
Functions ¶
func CheckBytes ¶
CheckBytes peeks at a buffered stream and checks if the first read bytes match.
func ExpandUser ¶
ExpandUser expands ~/path and ~otheruser/path appropriately
Types ¶
type Reader ¶
Reader is returned by Ropen
type Writer ¶
Writer is returned by Wopen
func Wopen ¶
Wopen opens a buffered reader. If f == "-", then stdout will be used. If f endswith ".gz", then the output will be gzipped.
func WopenFile ¶
WopenFile opens a buffered reader. If f == "-", then stdout will be used. If f endswith ".gz", then the output will be gzipped.