1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:20:22 -07:00

os: document that Windows Symlink to missing target creates file symlink

Fixes #39183

Change-Id: Iec4a5a561182ade57dc7dc24247710005d6b9f21
Reviewed-on: https://go-review.googlesource.com/c/go/+/314275
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Ian Lance Taylor 2021-04-27 16:55:04 -07:00
parent 352a322a83
commit 0d32d9e8a8
3 changed files with 6 additions and 0 deletions

View File

@ -440,6 +440,8 @@ func Link(oldname, newname string) error {
}
// Symlink creates newname as a symbolic link to oldname.
// On Windows, a symlink to a non-existent oldname creates a file symlink;
// if oldname is later created as a directory the symlink will not work.
// If there is an error, it will be of type *LinkError.
func Symlink(oldname, newname string) error {
return &LinkError{"symlink", oldname, newname, syscall.EPLAN9}

View File

@ -351,6 +351,8 @@ func Link(oldname, newname string) error {
}
// Symlink creates newname as a symbolic link to oldname.
// On Windows, a symlink to a non-existent oldname creates a file symlink;
// if oldname is later created as a directory the symlink will not work.
// If there is an error, it will be of type *LinkError.
func Symlink(oldname, newname string) error {
e := ignoringEINTR(func() error {

View File

@ -327,6 +327,8 @@ func Link(oldname, newname string) error {
}
// Symlink creates newname as a symbolic link to oldname.
// On Windows, a symlink to a non-existent oldname creates a file symlink;
// if oldname is later created as a directory the symlink will not work.
// If there is an error, it will be of type *LinkError.
func Symlink(oldname, newname string) error {
// '/' does not work in link's content