fileinput

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

README

fileinput

GoDoc Go Report Card

The fileinput package implements utility functions for building command-line tools and interacting with subprocesses.

Documentation

Overview

Package fileinput provides utility functions for handling files named on the command line.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatReader added in v0.1.0

type CatReader struct {
	// contains filtered or unexported fields
}

A CatReader implements io.ReadCloser for the concatenation of a sequence of file paths. The files are opened and closed on-demand as the data are read. The caller must close the reader to release any open filehandle.

func Cat

func Cat(paths []string) *CatReader

Cat constructs a CatReader for the specified file paths. If no files are specified, the resulting reader is empty, returning io.EOF for all reads.

func (*CatReader) Close added in v0.1.0

func (c *CatReader) Close() error

Close implements the io.Closer interface. After closing c, any further reads will report io.EOF, even if there were unconsumed files prior to close.

func (*CatReader) Read added in v0.1.0

func (c *CatReader) Read(data []byte) (int, error)

Read implements the io.Reader interface. It reports io.EOF when all the files have been completely read and no further data are available.

Jump to

Keyboard shortcuts

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