1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00
Files
incus/internal/io/filesystem_unix.go
Denys Mosiiuk f0c4438e70 incus/io: #2636 fix linter complaints in internal/io
Changes:

  - Added missing docstrings.
  - Renamed `min` function parameter to `minimum`.

Signed-off-by: Denys Mosiiuk <dmos@dector.space>
2025-12-15 23:32:15 +01:00

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
}