system

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package system provides ergonomic wrappers for operating system APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(dst io.Writer, src io.Reader) (int64, error)

Copy has identical semantics to io.Copy except it will automatically resume the copy after it receives an EINTR error.

func CopyN

func CopyN(dst io.Writer, src io.Reader, n int64) (written int64, err error)

CopyN has identical semantics to io.CopyN except it will automatically resume the copy after it receives an EINTR error.

func Lclearxattrs

func Lclearxattrs(path string, skipFn func(xattrName string) bool) error

Lclearxattrs is a wrapper around Llistxattr and Lremovexattr, which attempts to remove all xattrs from a given file.

If skipFn is non-nil and returns true when passed an xattr we planned to remove, that xattr is skipped and remains set on the path.

func Lgetxattr

func Lgetxattr(path string, name string) ([]byte, error)

Lgetxattr is a wrapper around unix.Lgetattr, to abstract the resizing of the returned []string.

func Llistxattr

func Llistxattr(path string) ([]string, error)

Llistxattr is a wrapper around unix.Llistattr, to abstract the NUL-splitting and resizing of the returned []string.

func Lutimes

func Lutimes(path string, atime, mtime time.Time) error

Lutimes is a wrapper around utimensat(2), with the AT_SYMLINK_NOFOLLOW flag set, to allow changing the time of a symlink rather than the file it points to.

func Mknod

func Mknod(path string, mode uint32, dev uint64) error

Mknod creates a filesystem node (file, device special file or named pipe) named path with attributes specified by mode and dev.

func Tarmode

func Tarmode(typeflag byte) uint32

Tarmode takes a Typeflag (from a tar.Header for example) and returns the corresponding os.Filemode bit. Unknown typeflags are treated like regular files.

Types

This section is empty.

Jump to

Keyboard shortcuts

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