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: IsPermission broken on Windows #3482

Closed
gopherbot opened this issue Apr 5, 2012 · 5 comments
Closed

os: IsPermission broken on Windows #3482

gopherbot opened this issue Apr 5, 2012 · 5 comments

Comments

@gopherbot
Copy link

by kfox1111:

Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:

Run "go version" and compare against
http://golang.org/doc/devel/release.html  If a newer version of Go exists,
install it and retry what you did to reproduce the problem.

Thanks.

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. on windows, create a file "test.txt". Right click on it and change its
permissions so that your user can't read it.

2.
foo, err = os.Open("test.txt")
if os.IsPermission(err) {
  fmt.Printf("Permission error!\n")

What is the expected output?
Permission error!

What do you see instead?
IsPermission does not return true

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Windows

Which version are you using?  (run 'go version')
1

Please provide any additional information below.
@alberts
Copy link
Contributor

alberts commented Apr 5, 2012

Comment 1:

do you get any error?

@minux
Copy link
Member

minux commented Apr 5, 2012

Comment 2:

I confirm os.IsPermission is broken on Windows (in fact you can see that ErrPermission
isn't
used in windows related os source), this is partly because we don't know which error
should
be mapped to it, IMHO.
I will test this case and see which error it will produce.

Labels changed: added priority-later, os-windows, removed priority-triage.

Status changed to Accepted.

@alexbrainman
Copy link
Member

Comment 3:

http://golang.org/cl/5987070/

Status changed to Started.

@alexbrainman
Copy link
Member

Comment 4:

This issue was closed by revision 8e109af.

Status changed to Fixed.

@alexbrainman
Copy link
Member

Comment 5:

This issue was closed by revision 2ae5665e698c.

alexbrainman added a commit that referenced this issue May 11, 2015
««« backport 1b2b113a2d66
os: fix IsPermission on windows

Fixes #3482.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5987070
»»»
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants