zstdzgo.at/zstd/zos Index | Files

package zos

import "zgo.at/zstd/zos"

Package zos implements functions for interfacing with the operating system.

Index

Constants

const (
	SIGUSR1 = syscall.SIGUSR1
	SIGUSR2 = syscall.SIGUSR2
)
const (
	Setuid uint32 = 1 << (12 - 1 - iota)
	Setgid
	Sticky
	UserRead
	UserWrite
	UserExecute
	GroupRead
	GroupWrite
	GroupExecute
	OtherRead
	OtherWrite
	OtherExecute
)

Functions

func Arg

func Arg(n int) string

Arg gets the nth argument from os.Args, or an empty string if os.Args is too short.

func CreateNew

func CreateNew(path string, zeroByte bool) (*os.File, error)

CreateNew creates a new file.

An error is returned if the file already exists, unless zeroByte is set it's a zero-byte file. Note that this is subject to race conditions, and not suitable if multiple processes may create the same file.

func Readable

func Readable(s os.FileInfo) (bool, error)

Readable reports if the file is readable by the current user.

func Writable

func Writable(s os.FileInfo) (bool, error)

Writable reports if the file is writable by the current user.

Types

type Permission

type Permission struct {
	Read    bool
	Write   bool
	Execute bool
}

type Permissions

type Permissions struct {
	User  Permission
	Group Permission
	Other Permission
}

func ReadPermissions

func ReadPermissions(mode os.FileMode) Permissions

ReadPermissions reads all Unix permissions.

Source Files

signal_posix.go zos.go zos_unix.go

Version
v0.0.0-20240930202209-a63c3335042a (latest)
Published
Sep 30, 2024
Platform
linux/amd64
Imports
5 packages
Last checked
2 days ago

Tools for package owners.