mirror of
https://github.com/golang/go
synced 2024-11-21 15:54:43 -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:
parent
231fcea7e6
commit
1c9dfb7647
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user