mirror of
https://github.com/golang/go
synced 2024-11-24 21:10:04 -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 {
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user