diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-03 21:58:02 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-03 21:58:02 +0000 |
commit | 0694cef2844753fb80be4f71f7d2eb82eb5ba464 (patch) | |
tree | 2f8da9862a9c1fe0df138917f997b03439c02773 /libgo/go/os/file.go | |
parent | 397fecd695789eccab667bf771a354df71d843e8 (diff) | |
download | gcc-0694cef2844753fb80be4f71f7d2eb82eb5ba464.tar.gz |
libgo: Update to go1.6rc1.
Reviewed-on: https://go-review.googlesource.com/19200
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233110 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/os/file.go')
-rw-r--r-- | libgo/go/os/file.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libgo/go/os/file.go b/libgo/go/os/file.go index 8c0e3ffe1ba..4f8e3f3450c 100644 --- a/libgo/go/os/file.go +++ b/libgo/go/os/file.go @@ -52,8 +52,8 @@ var ( Stderr = NewFile(uintptr(syscall.Stderr), "/dev/stderr") ) -// Flags to Open wrapping those of the underlying system. Not all flags -// may be implemented on a given system. +// Flags to OpenFile wrapping those of the underlying system. Not all +// flags may be implemented on a given system. const ( O_RDONLY int = syscall.O_RDONLY // open the file read-only. O_WRONLY int = syscall.O_WRONLY // open the file write-only. @@ -93,9 +93,6 @@ func (f *File) Read(b []byte) (n int, err error) { return 0, ErrInvalid } n, e := f.read(b) - if n < 0 { - n = 0 - } if n == 0 && len(b) > 0 && e == nil { return 0, io.EOF } @@ -176,6 +173,7 @@ func (f *File) WriteAt(b []byte, off int64) (n int, err error) { // according to whence: 0 means relative to the origin of the file, 1 means // relative to the current offset, and 2 means relative to the end. // It returns the new offset and an error, if any. +// The behavior of Seek on a file opened with O_APPEND is not specified. func (f *File) Seek(offset int64, whence int) (ret int64, err error) { if f == nil { return 0, ErrInvalid @@ -258,7 +256,9 @@ func Create(name string) (*File, error) { // lstat is overridden in tests. var lstat = Lstat -// Rename renames (moves) a file. OS-specific restrictions might apply. +// Rename renames (moves) oldpath to newpath. +// If newpath already exists, Rename replaces it. +// OS-specific restrictions may apply when oldpath and newpath are in different directories. // If there is an error, it will be of type *LinkError. func Rename(oldpath, newpath string) error { return rename(oldpath, newpath) |