Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

No fsync on history file? I lost my history



Hi there!

I just experienced a kernel oops. When I was back after a hard reset,
I lost my entire zsh history: the file was truncated to zero bytes.

I noticed zsh writes to a temporary file first, then renames, but
doesn't call fsync after finishing writing. I talked with my friend
knowing a lot about filesystems and I think a fsync will prevent this
kind of thing (or it'll be a kernel bug).

What do you think? Would you add the fsync call or make an option for
that? I recovered from a backup but it was not great experience.

Please cc me because I'm not subscribed.

-- 
Best regards,
lilydjwg



Messages sorted by: Reverse Date, Date, Thread, Author