Skip to content
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

os, io/ioutil: clarify ioutil.WriteFile and os.Mkdir docs re permissions and umask #35835

Closed
mostynb opened this issue Nov 25, 2019 · 2 comments
Labels
Documentation FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@mostynb
Copy link
Contributor

mostynb commented Nov 25, 2019

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.

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
@gopherbot
Copy link

Change https://golang.org/cl/208838 mentions this issue: doc: clarify interaction of ioutil.WriteFile with umask

@dmitshur dmitshur changed the title clarify ioutil.WriteFile and os.Mkdir docs re permissions and umask os, io/ioutil: clarify ioutil.WriteFile and os.Mkdir docs re permissions and umask Nov 26, 2019
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 26, 2019
@dmitshur
Copy link
Contributor

/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
@golang golang locked and limited conversation to collaborators Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants