if fd == 0 {
rw = os.O_RDONLY
}
- f, err := os.Open("/dev/null", rw, 0)
+ f, err := os.Open(os.DevNull, rw, 0)
return f, nil, err
case PassThrough:
switch fd {
bufp int // location of next record in buf.
}
+// DevNull is the name of the operating system's ``null device.''
+// On Unix-like systems, it is "/dev/null"; on Windows, "NUL".
+const DevNull = "/dev/null"
+
// Open opens the named file with specified flag (O_RDONLY etc.) and perm, (0666 etc.)
// if applicable. If successful, methods on the returned File can be used for I/O.
// It returns the File and an Error, if any.
usefirststat bool
}
+const DevNull = "NUL"
+
func (file *File) isdir() bool { return file != nil && file.dirinfo != nil }
func openFile(name string, flag int, perm int) (file *File, err Error) {