diff options
Diffstat (limited to 'libgo/go/os/dir_plan9.go')
-rw-r--r-- | libgo/go/os/dir_plan9.go | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/libgo/go/os/dir_plan9.go b/libgo/go/os/dir_plan9.go index 7822820..f2dc154 100644 --- a/libgo/go/os/dir_plan9.go +++ b/libgo/go/os/dir_plan9.go @@ -10,22 +10,7 @@ import ( "syscall" ) -// Readdir reads the contents of the directory associated with file and -// returns an array of up to n FileInfo structures, as would be returned -// by Lstat, in directory order. Subsequent calls on the same file will yield -// further FileInfos. -// -// If n > 0, Readdir returns at most n FileInfo structures. In this case, if -// Readdirnames returns an empty slice, it will return a non-nil error -// explaining why. At the end of a directory, the error is io.EOF. -// -// If n <= 0, Readdir returns all the FileInfo from the directory in -// a single slice. In this case, if Readdir succeeds (reads all -// the way to the end of the directory), it returns the slice and a -// nil error. If it encounters an error before the end of the -// directory, Readdir returns the FileInfo read until that point -// and a non-nil error. -func (file *File) Readdir(n int) (fi []FileInfo, err error) { +func (file *File) readdir(n int) (fi []FileInfo, err error) { // If this file has no dirinfo, create one. if file.dirinfo == nil { file.dirinfo = new(dirInfo) @@ -76,19 +61,7 @@ func (file *File) Readdir(n int) (fi []FileInfo, err error) { return result, nil } -// Readdirnames reads and returns a slice of names from the directory f. -// -// If n > 0, Readdirnames returns at most n names. In this case, if -// Readdirnames returns an empty slice, it will return a non-nil error -// explaining why. At the end of a directory, the error is io.EOF. -// -// If n <= 0, Readdirnames returns all the names from the directory in -// a single slice. In this case, if Readdirnames succeeds (reads all -// the way to the end of the directory), it returns the slice and a -// nil error. If it encounters an error before the end of the -// directory, Readdirnames returns the names read until that point and -// a non-nil error. -func (file *File) Readdirnames(n int) (names []string, err error) { +func (file *File) readdirnames(n int) (names []string, err error) { fi, err := file.Readdir(n) names = make([]string, len(fi)) for i := range fi { |