On Mon, Feb 14, 2005 at 04:56:30PM +0100, Vincent Lefevre wrote: > Then the current zsh instances went on writing to the history file > without noticing that it had been truncated, hence the null bytes. I think this is an NFS problem, since the zsh instances do not keep the history file open -- they just open the file for appending, and add an item to the end. When the file is rewritten, it is opened for writing with O_TRUNC, and the new contents output. A little while ago I wrote a patch that caused zsh to change its rewriting strategy to use a HISTORY_FILE.new file and then rename it into place. The purpose of this patch is to avoid losing any history if zsh gets interrupted during the writing of the new history file. However, it should also be a friendlier update strategy for NFS dirs because the inode of the file changes. The downside is that it can undo some user's use of symlinks, hardlinks, or special group permissions on their history file (because it is replacing the history file instead of rewriting it in-place). Perhaps this algorithm should be made optional? I've attached a diff in case you want to try it out. ..wayne..