Browse Source

bug fix: WriteFileAtomic

Must close file before rename it.
pull/1780/head
Mohanson 7 years ago
committed by GitHub
parent
commit
2fbd9f15fa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      common/os.go

+ 1
- 0
common/os.go View File

@ -148,6 +148,7 @@ func WriteFileAtomic(filename string, data []byte, perm os.FileMode) error {
} else if n < len(data) {
return io.ErrShortWrite
}
f.Close()
return os.Rename(f.Name(), filename)
}


Loading…
Cancel
Save