Files
zyedidia.micro/internal/buffer
rfjakob 1b4f6ecb12 save: fsync data safely to disk (#2681)
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().
2023-05-25 22:21:19 -07:00
..
2020-10-19 20:36:14 -04:00
2020-05-20 16:47:08 -04:00
2021-08-21 17:58:30 -04:00
2020-09-16 00:08:01 -04:00
2019-12-25 17:05:10 -05:00