New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get file owners (uid/gid) #14753
Comments
Let's move this to https://golang.org/wiki/Questions |
So where is the answer there? (I don't see any search for wiki) |
The page explains where to ask questions. It doesn't contain the answer to your question itself. The answer is os.Stat's FileInfo.Sys. |
os.File.Stat FileInfo.Sys and it is not cross-platform. |
(Numerical) Uid and Gid are not portable across all systems supported by Go
anyway.
|
Not portable even between two remote Linux systems. Or if filesystem doesn't support them. What is the return value of |
not all systems use numerical uid/gids.
|
How to detect what kind of |
Please ask questions on other mediums, see https://golang.org/wiki/Questions
.
|
go version
)?-bash-4.1# go version
go version go1.5.1 linux/amd64
go env
)?-bash-4.1# go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT=""
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
I can not find a way to read the owner uid/gid of a file.
Looking a the OS functions, I see chmod and chown, but there is no corresponding functions to actually see the current values.
https://golang.org/pkg/os/
A way to read the uid/gid owener of a file.
Such a function is not present.
The text was updated successfully, but these errors were encountered: