pseudofs

package
v0.0.0-...-c9cfaf6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package pseudofs provides helpers for interacting with pseudo filesystems such as procfs and sysfs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flag

func Flag(path string) (bool, error)

Flag reads a boolean from a file, represented as 0 or 1.

func Int

func Int(path string) (int, error)

Int reads an integer from a file.

func Ints

func Ints(path string) (_ []int, err error)

Ints reads a list of integers from a file.

func String

func String(path string) (string, error)

String reads a string from path, trimming whitespace.

func WriteFile

func WriteFile(path string, data []byte, perm uint32) (err error)

WriteFile writes data to path with a single write syscall.

func WriteFlag

func WriteFlag(path string, enabled bool) error

WriteFlag writes a boolean to a file.

func WriteInt

func WriteInt(path string, n int) error

WriteInt writes an integer to a file.

func WriteInts

func WriteInts(path string, ns []int) error

WriteInts writes a list of integers to a file with one write per entry.

func WriteString

func WriteString(path, s string) error

WriteString writes a string to a file, followed by a newline.

Types

This section is empty.

Jump to

Keyboard shortcuts

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