Commit 5514332e authored by Shenghou Ma's avatar Shenghou Ma Committed by Minux Ma

os: deduplicate File definition

Fixes #16993.

Change-Id: Ibe406f97d2a49acae94531d969c56dbac8ce53b2
Reviewed-on: https://go-review.googlesource.com/28511
Run-TryBot: Minux Ma <minux@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 269ff8e6
...@@ -11,11 +11,6 @@ import ( ...@@ -11,11 +11,6 @@ import (
"time" "time"
) )
// File represents an open file descriptor.
type File struct {
*file
}
// file is the real representation of *File. // file is the real representation of *File.
// The extra level of indirection ensures that no clients of os // The extra level of indirection ensures that no clients of os
// can overwrite this data, which could cause the finalizer // can overwrite this data, which could cause the finalizer
......
...@@ -19,11 +19,6 @@ func rename(oldname, newname string) error { ...@@ -19,11 +19,6 @@ func rename(oldname, newname string) error {
return nil return nil
} }
// File represents an open file descriptor.
type File struct {
*file
}
// file is the real representation of *File. // file is the real representation of *File.
// The extra level of indirection ensures that no clients of os // The extra level of indirection ensures that no clients of os
// can overwrite this data, which could cause the finalizer // can overwrite this data, which could cause the finalizer
......
...@@ -15,11 +15,6 @@ import ( ...@@ -15,11 +15,6 @@ import (
"unsafe" "unsafe"
) )
// File represents an open file descriptor.
type File struct {
*file
}
// file is the real representation of *File. // file is the real representation of *File.
// The extra level of indirection ensures that no clients of os // The extra level of indirection ensures that no clients of os
// can overwrite this data, which could cause the finalizer // can overwrite this data, which could cause the finalizer
......
...@@ -12,6 +12,11 @@ import ( ...@@ -12,6 +12,11 @@ import (
// Getpagesize returns the underlying system's memory page size. // Getpagesize returns the underlying system's memory page size.
func Getpagesize() int { return syscall.Getpagesize() } func Getpagesize() int { return syscall.Getpagesize() }
// File represents an open file descriptor.
type File struct {
*file // os specific
}
// A FileInfo describes a file and is returned by Stat and Lstat. // A FileInfo describes a file and is returned by Stat and Lstat.
type FileInfo interface { type FileInfo interface {
Name() string // base name of the file Name() string // base name of the file
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment