fifo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2016 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Overview

Package fifo implements first-in-first-out objects logic.

Index

Constants

View Source
const (
	// O_NONBLOCK flag makes Fifo open operation nonblocking.
	O_NONBLOCK = common.O_NONBLOCK
)

Variables

This section is empty.

Functions

func Destroy

func Destroy(name string) error

Destroy permanently removes the FIFO.

func DestroyNamedPipe

func DestroyNamedPipe(name string) error

DestroyNamedPipe is a no-op on windows.

Types

type Fifo

type Fifo interface {
	io.ReadWriter
	io.Closer
	ipc.Destroyer
}

Fifo represents a First-In-First-Out object

func New

func New(name string, flag int, perm os.FileMode) (Fifo, error)

New creates or opens a new FIFO object

name - object name.
flag - flag is a combination of open flags from 'os' package along with O_NONBLOCK flag.
perm - object's permission bits.

type NamedPipe

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

NamedPipe is a first-in-first-out ipc mechanism.

func NewNamedPipe

func NewNamedPipe(name string, flag int, perm os.FileMode) (*NamedPipe, error)

NewNamedPipe creates a new windows named pipe.

name - object name.
flag - flag is a combination of open flags from 'os' package.
perm - object's permission bits.

func (*NamedPipe) Close

func (f *NamedPipe) Close() error

Close closes the object.

func (*NamedPipe) Destroy

func (f *NamedPipe) Destroy() error

Destroy does the same as Close does. It is impossible to destroy named pipe explicitly, it will be destroyed by the OS when all its handles are closed.

func (*NamedPipe) Read

func (f *NamedPipe) Read(b []byte) (n int, err error)

Read reads from the given FIFO. it must be opened for reading.

func (*NamedPipe) Write

func (f *NamedPipe) Write(b []byte) (n int, err error)

Write writes to the given FIFO. it must be opened for writing.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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