We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d931b3b commit 1309f0cCopy full SHA for 1309f0c
src/os/file.go
@@ -710,6 +710,8 @@ func ReadFile(name string) ([]byte, error) {
710
// WriteFile writes data to the named file, creating it if necessary.
711
// If the file does not exist, WriteFile creates it with permissions perm (before umask);
712
// otherwise WriteFile truncates it before writing, without changing permissions.
713
+// Since Writefile requires multiple system calls to complete, a failure mid-operation
714
+// can leave the file in a partially written state.
715
func WriteFile(name string, data []byte, perm FileMode) error {
716
f, err := OpenFile(name, O_WRONLY|O_CREATE|O_TRUNC, perm)
717
if err != nil {
0 commit comments