If you start GnuCash when there is no ~/.gnucash directory, and then
(without doing anything else) import a QIF file, the following error is
produced, and gnucash exits:

ERROR: In procedure open-file in expression (open-file str OPEN_WRITE):
ERROR: No such file or directory: "/home/olaf/.gnucash/qif-accounts-map"

The procedure (qif-import:save-map-prefs prefs) uses
(with-output-to-file ...) which apparently doesn't create the
subdirectory chain if necessary.  The file containing that procedure is
gnucash/src/scm/qif-import/qif-guess-map.scm.

Saving a gnucash data file does appear to create the necessary directory
(so it can save the configuration file) so if you only do an import
after creating the data file the error does not occur.

So if that behavior is more desireable than just creating the directory
when gnucash starts, then perhaps the right thing to do is add a
procedure to qif-utils.scm like this?

with-output-to-file-gnucash filename
  directory = dirname(filename)
  if not (-d directory)
    then mkdir directory
  with-output-to-file filename

Excuse the ugly fake code.  I don't know scheme.

I didn't attempt to figure out where one would just create the directory
on startup if that's the method that is more desireable.

-Olaf

--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]


Reply via email to