You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g (i386 version)
Which operating system are you using?
Windows 7 Professional SP1
Which version are you using? (run 'go version')
go version go1.0.3
How to reproduce the problem
Compile this test program: http://play.golang.org/p/rBGf11wDo7 (dir.exe in transcript
below)
Insert a usb stick, format it and make sure it has no files on it (F: below)
------------------------------------------------------------
C:\>dir f:
Volume in drive F is EOS_DIGITAL
Volume Serial Number is xxxx-xxxx
Directory of F:\
File Not Found
------------------------------------------------------------
Now try the test program which produces these errors rather than an empty directory
listing
------------------------------------------------------------
C:\>dir.exe f:
entries []
err open f:: Access is denied.
Couldn't read directory "f:": open f:: Access is denied.
C:\>dir.exe f:\
entries []
err open f:\: The system cannot find the path specified.
Couldn't read directory "f:\\": open f:\: The system cannot find the path
specified.
------------------------------------------------------------
Creating a file allows the test program to work, showing that this user does have
permission to write to F:
------------------------------------------------------------
C:\>echo hello > f:\test.txt
C:\>dir f:
Volume in drive F is EOS_DIGITAL
Volume Serial Number is xxxx-xxxx
Directory of F:\
31/12/2012 11:25 8 test.txt
1 File(s) 8 bytes
0 Dir(s) 15,995,928,576 bytes free
C:\>dir.exe f:
entries [0x115714b0]
err <nil>
C:\>dir.exe f:\
entries [0x11671510]
err <nil>
------------------------------------------------------------
And removing the file causes it to fail again
------------------------------------------------------------
C:\>del f:\test.txt
C:\>dir f:
Volume in drive F is EOS_DIGITAL
Volume Serial Number is xxxx-xxxx
Directory of F:\
File Not Found
C:\>dir.exe f:
entries []
err open f:: Access is denied.
Couldn't read directory "f:": open f:: Access is denied.
C:\>dir.exe f:\
entries []
err open f:\: The system cannot find the path specified.
Couldn't read directory "f:\\": open f:\: The system cannot find the path
specif
ied.
------------------------------------------------------------
Compare with an empty local directory which doesn't produce any errors
------------------------------------------------------------
C:\>dir z
Volume in drive C has no label.
Volume Serial Number is xxxx-xxxx
Directory of C:\z
31/12/2012 11:32 <DIR> .
31/12/2012 11:32 <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 222,535,602,176 bytes free
C:\>dir.exe z
entries []
err <nil>
------------------------------------------------------------
This behavior is inconsistent and looks wrong to me. I would expect ReadDir to produce
an empty directory listing not an error.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: