fifo – github.com/containerd/fifo Index | Files

package fifo

import "github.com/containerd/fifo"

Index

Variables

var (
	ErrClosed      = errors.New("fifo closed")
	ErrCtrlClosed  = errors.New("control of closed fifo")
	ErrRdFrmWRONLY = errors.New("reading from write-only fifo")
	ErrReadClosed  = errors.New("reading from a closed fifo")
	ErrWrToRDONLY  = errors.New("writing to read-only fifo")
	ErrWriteClosed = errors.New("writing to a closed fifo")
)

Functions

func IsFifo

func IsFifo(path string) (bool, error)

IsFifo checks if a file is a (named pipe) fifo if the file does not exist then it returns false

func OpenFifo

func OpenFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error)

OpenFifo opens a fifo. Returns io.ReadWriteCloser. Context can be used to cancel this function until open(2) has not returned. Accepted flags:

func OpenFifoDup2

func OpenFifoDup2(ctx context.Context, fn string, flag int, perm os.FileMode, fd int) (io.ReadWriteCloser, error)

OpenFifoDup2 is same as OpenFifo, but additionally creates a copy of the FIFO file descriptor with dup2 syscall.

Source Files

errors.go fifo.go handle_nolinux.go raw.go utils.go

Version
v1.1.0 (latest)
Published
Feb 17, 2023
Platform
js/wasm
Imports
9 packages
Last checked
now

Tools for package owners.