Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upos, io/ioutil: clarify ioutil.WriteFile and os.Mkdir docs re permissions and umask #35835
Labels
Comments
mostynb
added a commit
to mostynb/go
that referenced
this issue
Nov 25, 2019
Note that ioutil.WriteFile's perm argument is the value before the umask is applied. Also make os.Mkdir's documentation consistent with other mentions of permissions arguments in the os package. Fixes golang#35835 Change-Id: I61cd9c88bced3be52b616d86e060cd3fd912ab1f
This comment has been minimized.
This comment has been minimized.
Change https://golang.org/cl/208838 mentions this issue: |
This comment has been minimized.
This comment has been minimized.
/cc @bradfitz @ianlancetaylor per owners. |
mostynb
added a commit
to mostynb/go
that referenced
this issue
Nov 27, 2019
Note that ioutil.WriteFile's perm argument is the value before the umask is applied. Fixes golang#35835 Change-Id: I61cd9c88bced3be52b616d86e060cd3fd912ab1f
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Go are you using (
go version
)?go1.13.4
Does this issue reproduce with the latest release?
Yes
What did you do?
I noticed that the ioutil.WriteFile docs say "with permissions perm", but without any mention of umask:
https://golang.org/pkg/io/ioutil/#example_WriteFile
The implementation passes perm to os.OpenFile, whose docs do describe the interaction with the umask.
Then while browsing the os package's docs, I noticed a minor inconsistency in the phrasing around the permissions argument for os.Mkdir compared to os.MkdirAll and some other places in that pckage.
What did you expect to see?
Umask mentioned in ioutil.WriteFile docs.
What did you see instead?
No mention.