1
0
mirror of https://github.com/golang/go synced 2024-11-21 22:14:41 -07:00

os: correct Stat S_ISDIR on Windows

R=rsc, brainman
CC=golang-dev
https://golang.org/cl/2598041
This commit is contained in:
Yasuhiro Matsumoto 2010-10-21 10:29:45 +11:00 committed by Alex Brainman
parent 231fcea7e6
commit 1c9dfb7647

View File

@ -26,12 +26,12 @@ func fileInfoFromByHandleInfo(fi *FileInfo, name string, d *syscall.ByHandleFile
func setFileInfo(fi *FileInfo, name string, fa, sizehi, sizelo uint32, ctime, atime, wtime syscall.Filetime) *FileInfo {
fi.Mode = 0
if fa == syscall.FILE_ATTRIBUTE_DIRECTORY {
if fa&syscall.FILE_ATTRIBUTE_DIRECTORY != 0 {
fi.Mode = fi.Mode | syscall.S_IFDIR
} else {
fi.Mode = fi.Mode | syscall.S_IFREG
}
if fa == syscall.FILE_ATTRIBUTE_READONLY {
if fa&syscall.FILE_ATTRIBUTE_READONLY != 0 {
fi.Mode = fi.Mode | 0444
} else {
fi.Mode = fi.Mode | 0666