Browse Source

refine comments

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

+ 1
- 2
common/os.go View File

@ -149,8 +149,7 @@ func WriteFileAtomic(filename string, data []byte, perm os.FileMode) error {
return io.ErrShortWrite
}
// Close the file before renaming it, otherwise it will cause "The process
// cannot access the file because it is being used by another process." on windows or
// cause "cross-link error" on linux when you try to save it to another partition.
// cannot access the file because it is being used by another process." on windows.
f.Close()
return os.Rename(f.Name(), filename)


Loading…
Cancel
Save