Commit 1c9dfb76 authored by Yasuhiro Matsumoto's avatar Yasuhiro Matsumoto Committed by Alex Brainman

os: correct Stat S_ISDIR on Windows

R=rsc, brainman
CC=golang-dev
https://golang.org/cl/2598041
parent 231fcea7
...@@ -26,12 +26,12 @@ func fileInfoFromByHandleInfo(fi *FileInfo, name string, d *syscall.ByHandleFile ...@@ -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 { func setFileInfo(fi *FileInfo, name string, fa, sizehi, sizelo uint32, ctime, atime, wtime syscall.Filetime) *FileInfo {
fi.Mode = 0 fi.Mode = 0
if fa == syscall.FILE_ATTRIBUTE_DIRECTORY { if fa&syscall.FILE_ATTRIBUTE_DIRECTORY != 0 {
fi.Mode = fi.Mode | syscall.S_IFDIR fi.Mode = fi.Mode | syscall.S_IFDIR
} else { } else {
fi.Mode = fi.Mode | syscall.S_IFREG 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 fi.Mode = fi.Mode | 0444
} else { } else {
fi.Mode = fi.Mode | 0666 fi.Mode = fi.Mode | 0666
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment