util

package
v0.0.0-...-e377a08 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSymlink(target, newPath string) error

CreateSymlink creates a symbolic link. An existing newPath will be removed. target path must be absolute.

func DirExists

func DirExists(path string) bool

DirExists returns whether the given directory exists.

func ErrorToRc

func ErrorToRc(err error) (uint8, string)

ErrorToRc turns an error value into a Bash like exit code and an error message.

func FileExists

func FileExists(path string) bool

FileExists returns whether the given regular file exists.

func Killall

func Killall()

Killall sends SIGKILL to all processes except init.

func MachineType

func MachineType() (string, error)

MachineType returns the s390x machine type z13 : 2965 z14 : 3906 z15 : 8561 (T01) or 8562 (T02)

func MajorMinor

func MajorMinor(path string) (int, int, error)

MajorMinor returns major and minor device number for a given dev file.

func Mknod

func Mknod(path, devtype string, fmode uint32, major, minor int) error

Mknod creates character or block device files.

func RandStr

func RandStr(n int) string

RandStr returns a random string [0-9a-f]{n}.

func SetSysctl

func SetSysctl(name string, value string) error

SetSysctl sets a syscontrol.

func ToBool

func ToBool(s string) bool

ToBool returns true for strings that represent a true value.

func UserHome

func UserHome(uid int) string

UserHome returns the home directory for uid or "/" if a home directory can't be found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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