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
Closed

Comments

@mostynb
Copy link
Contributor

@mostynb 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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 25, 2019

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

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Nov 26, 2019

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
@gopherbot gopherbot closed this in 95c9a65 Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.