Fixes #4444.
R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/
6858079
t.Errorf("Write to os.Stderr should return %d; got %d", len(b), n)
}
}
+
+func TestStatDirModeExec(t *testing.T) {
+ const mode = 0111
+ const path = "."
+ dir, err := Stat(path)
+ if err != nil {
+ t.Fatalf("Stat %q (looking for mode %#o): %s", path, mode, err)
+ }
+ if dir.Mode()&mode != mode {
+ t.Errorf("Stat %q: mode %#o want %#o", path, dir.Mode(), mode)
+ }
+}
func mkMode(fa uint32) (m FileMode) {
if fa&syscall.FILE_ATTRIBUTE_DIRECTORY != 0 {
- m |= ModeDir
+ m |= ModeDir | 0111
}
if fa&syscall.FILE_ATTRIBUTE_READONLY != 0 {
m |= 0444