package sys

import "aqwari.net/net/styx/internal/sys"

Package sys contains non-portable routines.

Index

Constants

const (
	DefaultUid  = ""
	DefaultGid  = ""
	DefaultMuid = ""
)

DefaultUid and DefaultGid are the default group and owner for a file if ownership information cannot be retrieved.

Functions

func FileOwner

func FileOwner(fi os.FileInfo) (uid, gid, muid string)

FileOwner retrieves ownership information for a file. uid and gid are the owner and group of a file, respectively. muid is the uid of the user who last modified the file.

FileOwner will emply multiple strategies to get file ownership information. If fi or fi.Sys() implements any methods in the styx.OwnerInfo interface, they are used. Otherwise, FileOwner will attempt to retrieve ownership information from the host operating sytsem. If such information cannot be retrieved, FileOwner will fall back to DefaultUid and DefaultGid.

Source Files

doc.go group_go17.go owner.go owner_unix.go

Version
v0.0.0-20221011015736-bf55d759d56b (latest)
Published
Oct 11, 2022
Platform
linux/amd64
Imports
5 packages
Last checked
4 days ago

Tools for package owners.