File: stat_unix.go

package info (click to toggle)
golang-github-vbatts-go-mtree 0.5.4%2Bds-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 796 kB
  • sloc: sh: 198; makefile: 80
file content (19 lines) | stat: -rw-r--r-- 331 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//go:build !windows
// +build !windows

package mtree

import (
	"os"
	"syscall"
)

func statIsUID(stat os.FileInfo, uid int) bool {
	statT := stat.Sys().(*syscall.Stat_t)
	return statT.Uid == uint32(uid)
}

func statIsGID(stat os.FileInfo, gid int) bool {
	statT := stat.Sys().(*syscall.Stat_t)
	return statT.Gid == uint32(gid)
}