mirror of
https://github.com/zyedidia/micro.git
synced 2024-09-17 15:07:41 +03:00
On modern Linux systems, it can take 30 seconds for the data to actually hit the disk (check /proc/sys/vm/dirty_expire_centisecs). If the computer crashes in those 30 seconds, the user may end up with an empty file as seen here: https://github.com/neovim/neovim/issues/9888 This is why editors like vim and nano call the fsync syscall after they wrote the file. This syscall is available as file.Sync() in Go. Running strace against micro shows that fsync is called as expected: $ strace -f -p $(pgrep micro) -e fsync strace: Process 3284344 attached with 9 threads [pid 3284351] fsync(8) = 0 Also, we now catch errors returned from w.Flush(). |
||
---|---|---|
.. | ||
action | ||
buffer | ||
clipboard | ||
config | ||
display | ||
info | ||
lua | ||
screen | ||
shell | ||
util | ||
views |