aboutsummaryrefslogtreecommitdiff
path: root/src/os/file.go
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2024-07-24 10:29:13 -0700
committerDamien Neil <dneil@google.com>2024-07-24 18:24:15 +0000
commit910e6b5fae7cbf84e4a3fcfa6739e20239080bcd (patch)
treebb035d2b1bb39157686a5624d8aacbeff3f1c4e0 /src/os/file.go
parent074f2761b5ff54c9c9d2e2a720abd29efa5474cc (diff)
downloadgo-910e6b5fae7cbf84e4a3fcfa6739e20239080bcd.tar.xz
os: document CopyFS behavior for symlinks in destination
Also clarify the permissions of created files, and note that CopyFS will not overwrite files. Update a few places in documentation to use 0oXXX for octal consts. For #62484 Change-Id: I208ed2bde250304bc7fac2b93963ba57037e791e Reviewed-on: https://go-review.googlesource.com/c/go/+/600775 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/os/file.go')
-rw-r--r--src/os/file.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/os/file.go b/src/os/file.go
index b2fb328e13..541b432081 100644
--- a/src/os/file.go
+++ b/src/os/file.go
@@ -366,7 +366,7 @@ func Open(name string) (*File, error) {
}
// Create creates or truncates the named file. If the file already exists,
-// it is truncated. If the file does not exist, it is created with mode 0666
+// it is truncated. If the file does not exist, it is created with mode 0o666
// (before umask). If successful, methods on the returned File can
// be used for I/O; the associated file descriptor has mode O_RDWR.
// If there is an error, it will be of type *PathError.
@@ -606,11 +606,11 @@ func UserHomeDir() (string, error) {
// On Unix, the mode's permission bits, ModeSetuid, ModeSetgid, and
// ModeSticky are used.
//
-// On Windows, only the 0200 bit (owner writable) of mode is used; it
+// On Windows, only the 0o200 bit (owner writable) of mode is used; it
// controls whether the file's read-only attribute is set or cleared.
// The other bits are currently unused. For compatibility with Go 1.12
-// and earlier, use a non-zero mode. Use mode 0400 for a read-only
-// file and 0600 for a readable+writable file.
+// and earlier, use a non-zero mode. Use mode 0o400 for a read-only
+// file and 0o600 for a readable+writable file.
//
// On Plan 9, the mode's permission bits, ModeAppend, ModeExclusive,
// and ModeTemporary are used.