os

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package os implements a subset of the Go "os" package. See https://godoc.org/os for details.

Note that the current implementation is blocking. This limitation should be removed in a future version.

Index

Constants

This section is empty.

Variables

View Source
var (
	Stdin  = &File{0, "/dev/stdin"}
	Stdout = &File{1, "/dev/stdout"}
	Stderr = &File{2, "/dev/stderr"}
)

Stdin, Stdout, and Stderr are open Files pointing to the standard input, standard output, and standard error file descriptors.

View Source
var (
	ErrUnsupported = errors.New("operation not supported")
)

Portable analogs of some common system call errors.

Functions

This section is empty.

Types

type File

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

File represents an open file descriptor.

func NewFile

func NewFile(fd uintptr, name string) *File

NewFile returns a new File with the given file descriptor and name.

func (*File) Close

func (f *File) Close() error

Close is unsupported on this system.

func (*File) Fd

func (f *File) Fd() uintptr

Fd returns the integer Unix file descriptor referencing the open file. The file descriptor is valid only until f.Close is called.

func (*File) Read

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

Read is unsupported on this system.

func (*File) Write

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

Write writes len(b) bytes to the output. It returns the number of bytes written or an error if this file is not stdout or stderr.

Jump to

Keyboard shortcuts

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