package zos
import "zgo.at/zstd/zos"
Package zos implements functions for interfacing with the operating system.
Index ¶
- Constants
- func Arg(n int) string
- func CreateNew(path string, zeroByte bool) (*os.File, error)
- func Readable(s os.FileInfo) (bool, error)
- func Writable(s os.FileInfo) (bool, error)
- type Permission
- type Permissions
Constants ¶
const ( Setuid uint32 = 1 << (12 - 1 - iota) Setgid Sticky UserRead UserWrite UserExecute GroupRead GroupWrite GroupExecute OtherRead OtherWrite OtherExecute )
Functions ¶
func Arg ¶
Arg gets the nth argument from os.Args, or an empty string if os.Args is too short.
func CreateNew ¶
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 ¶
Readable reports if the file is readable by the current user.
func Writable ¶
Writable reports if the file is writable by the current user.
Types ¶
type Permission ¶
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.