os: clarify docs for link functions

R=golang-dev, bsiegert, r
CC=golang-dev
https://golang.org/cl/5643068
This commit is contained in:
Gustavo Niemeyer 2012-02-13 01:21:39 -02:00
parent 71c8b82dd1
commit 62fe6914cb
1 changed files with 3 additions and 4 deletions

View File

@ -37,7 +37,7 @@ func (e *LinkError) Error() string {
return e.Op + " " + e.Old + " " + e.New + ": " + e.Err.Error() return e.Op + " " + e.Old + " " + e.New + ": " + e.Err.Error()
} }
// Link creates a hard link. // Link creates newname as a hard link to the oldname file.
func Link(oldname, newname string) error { func Link(oldname, newname string) error {
e := syscall.Link(oldname, newname) e := syscall.Link(oldname, newname)
if e != nil { if e != nil {
@ -46,7 +46,7 @@ func Link(oldname, newname string) error {
return nil return nil
} }
// Symlink creates a symbolic link. // Symlink creates newname as a symbolic link to oldname.
func Symlink(oldname, newname string) error { func Symlink(oldname, newname string) error {
e := syscall.Symlink(oldname, newname) e := syscall.Symlink(oldname, newname)
if e != nil { if e != nil {
@ -55,8 +55,7 @@ func Symlink(oldname, newname string) error {
return nil return nil
} }
// Readlink reads the contents of a symbolic link: the destination of // Readlink returns the destination of the named symbolic link.
// the link. It returns the contents and an error, if any.
// If there is an error, it will be of type *PathError. // If there is an error, it will be of type *PathError.
func Readlink(name string) (string, error) { func Readlink(name string) (string, error) {
for len := 128; ; len *= 2 { for len := 128; ; len *= 2 {