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

No fsync on history file? I lost my history



(Resending to zsh-users because my message to zsh-workers seemed to be
ignored.)

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.

-- 
Best regards,
lilydjwg



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