mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
17 lines
275 B
Go
17 lines
275 B
Go
package io
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
// GetPathMode returns a os.FileMode for the provided path.
|
|
func GetPathMode(path string) (os.FileMode, error) {
|
|
fi, err := os.Stat(path)
|
|
if err != nil {
|
|
return os.FileMode(0o000), err
|
|
}
|
|
|
|
mode, _, _ := GetOwnerMode(fi)
|
|
return mode, nil
|
|
}
|