Rename os.FD to os.File.

Make Fstat, Readdirnames, and Readdir methods
on os.File.

R=r
DELTA=281  (79 added, 3 deleted, 199 changed)
OCL=25891
CL=26130
This commit is contained in:
Russ Cox 2009-03-11 12:51:10 -07:00
parent 6479d89378
commit 7a706fb3d7
19 changed files with 270 additions and 194 deletions

View file

@ -13,12 +13,12 @@ import (
)
type file struct {
fd *os.FD;
file *os.File;
data []byte;
}
func (f *file) close() {
f.fd.Close()
f.file.Close()
}
func (f *file) getLineFromData() (s string, ok bool) {
@ -46,7 +46,7 @@ func (f *file) readLine() (s string, ok bool) {
}
if len(f.data) < cap(f.data) {
ln := len(f.data);
n, err := io.Readn(f.fd, f.data[ln:cap(f.data)]);
n, err := io.Readn(f.file, f.data[ln:cap(f.data)]);
if n >= 0 {
f.data = f.data[0:ln+n];
}