mirror of
https://github.com/lxc/incus.git
synced 2026-02-05 09:46:19 +01:00
Changes: - Added missing docstrings. - Renamed `min` function parameter to `minimum`. Signed-off-by: Denys Mosiiuk <dmos@dector.space>
17 lines
350 B
Go
17 lines
350 B
Go
//go:build !windows
|
|
|
|
package io
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
// GetOwnerMode returns the file mode, owner UID, and owner GID for the given file.
|
|
func GetOwnerMode(fInfo os.FileInfo) (os.FileMode, int, int) {
|
|
mode := fInfo.Mode()
|
|
uid := int(fInfo.Sys().(*syscall.Stat_t).Uid)
|
|
gid := int(fInfo.Sys().(*syscall.Stat_t).Gid)
|
|
return mode, uid, gid
|
|
}
|