[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
OCTAVE_HISTFILE not honoured when file does exist
From: |
John W. Eaton |
Subject: |
OCTAVE_HISTFILE not honoured when file does exist |
Date: |
Mon, 6 Nov 2006 11:56:59 -0500 |
On 4-Nov-2006, Rafael Laboissiere wrote:
| I am trying to get Octave having separate history files in a per-directory
| basis. I did:
|
| export OCTAVE_HISTFILE=./.octave_hist
|
| However, this only works when the file .octave_hist already exists in the
| current directory.
Along with the patch I just sent, I should have also noted that if you
set the history file to a relative file name, then the file used to
initialize the history list will be the one found relative to the
current directory when Octave starts, and the history will be written
to the file found relative to the current directory when Octave
exits. This happens because readline does not keep the file open, but
instead opens it only when needed, then closes it as soon as it can
after reading or writing.
If that is not the behavior you want, then you might consider adding
something like
history_file (fullfile (pwd (), ".xxx-hist"));
to your .octaverc file. If you use 2.1.x, you would need to do
something like
history_file = fullfile (pwd (), ".xxx-hist");
instead.
jwe