refine comments
This commit is contained in:
parent
29a8cb8d87
commit
b221ca0efa
|
@ -149,8 +149,7 @@ func WriteFileAtomic(filename string, data []byte, perm os.FileMode) error {
|
||||||
return io.ErrShortWrite
|
return io.ErrShortWrite
|
||||||
}
|
}
|
||||||
// Close the file before renaming it, otherwise it will cause "The process
|
// 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
|
// cannot access the file because it is being used by another process." on windows.
|
||||||
// cause "cross-link error" on linux when you try to save it to another partition.
|
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|
||||||
return os.Rename(f.Name(), filename)
|
return os.Rename(f.Name(), filename)
|
||||||
|
|
Loading…
Reference in New Issue