I would like to have as a string
the permissions representation of a file.
Here is what I want to do :
fileInfo, err := os.Lstat(path)
fileMode := fileInfo.Mode()
// fileMode.String() gives dturwxrwxrwx or -rwxrwxrwx
// which i do not want because the size is not always the same
unixPerms := fileMode & os.ModePerm
I get -rwxrwxrwx
for both cases, which is close to what i am looking for.
However, the returned object is of type os.FileMode
. How can I then convert it into a string
?