io

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

IO

This package provides interfaces for working with file IO. Currently it provides functionality for consistently reading a file.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLimitReached = errors.New("the read limit is reached")

ErrLimitReached means that the read limit is reached.

Functions

func ConsistentRead

func ConsistentRead(filename string, attempts int) ([]byte, error)

ConsistentRead repeatedly reads a file until it gets the same content twice. This is useful when reading files in /proc that are larger than page size and kernel may modify them between individual read() syscalls.

func ReadAtMost

func ReadAtMost(r io.Reader, limit int64) ([]byte, error)

ReadAtMost reads up to `limit` bytes from `r`, and reports an error when `limit` bytes are read.

Types

This section is empty.

Jump to

Keyboard shortcuts

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