opencog / link-grammar

The CMU Link Grammar natural language parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stop litering `.lg_history` in current directory.

linas opened this issue · comments

Currently, this line:

#define HFILE ".lg_history"

causes the .lg_history file to be written in the current working directory, resulting in LG litter everywhere. It's getting annoying. It should be changed to either ~/.lg_history or to ~/.cache/link-grammar/lg_history

I tried changing it to ~/.lg_history but that did not work. Seems that history_w(hist, &ev, H_LOAD, HFILE); does not know what to do with the tilde. And, at any rate, this won't work in windows, anyway. So I'm opening this bug report instead ...

There is a function expand_homedir() in parser-utilities.h.
There is a comment there:

 * Note: ~user is not supported here on Windows.

However, it seems this is a comment rot since the code seem to support Windows (and 54f6723 says I tested it).

Cool, thanks, I'll trying hacking that up, unless you want to do it.

Please do it, because I'm preparing yet some other PRs just now.

Fixed, in #1446 for Linux only. I'm leaving this open, for Windows and Apple. Should be easy; just .. different #defines, right?

Closing because resolved in #1447.

Closed wrong issue.

See comments in #1446 for current status

I have just submitted PR #1534 - XDG-base-directory implementation that has per-dict history.