MCPcopy Index your code
hub / github.com/celer-pkg/celer / mountedDirGID

Function mountedDirGID

pkgcache/cache_setup_linux.go:13–25  ·  view source on GitHub ↗

mountedDirGID reads the numeric GID of a mounted directory.

(path string)

Source from the content-addressed store, hash-verified

11
12// mountedDirGID reads the numeric GID of a mounted directory.
13func mountedDirGID(path string) (string, error) {
14 info, err := os.Stat(path)
15 if err != nil {
16 return "", fmt.Errorf("failed to stat mounted NFS dir %q -> %w", path, err)
17 }
18
19 stat, ok := info.Sys().(*syscall.Stat_t)
20 if !ok {
21 return "", fmt.Errorf("failed to read numeric gid for mounted NFS dir %q", path)
22 }
23
24 return strconv.FormatUint(uint64(stat.Gid), 10), nil
25}

Callers 1

SetupMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected