Skip to content

Data directory seems baked-in to the directory where you compiled the app, and can't be changed #14

@jim-collier

Description

@jim-collier

The data directory location should be easily user-configurable and changeable, e.g. via CLI flag, and/or a config file such as ~/.config/typon.conf. But it doesn't seem to be.

I always compile applications in /tmp, so that cruft doesn't build up. Which gets deleted after every reboot. After realizing the data directory got created under that temporary git project directory for some weird reason, I copied the following data to ~/.local/share/typon/ before my next reboot:

  • quotes/
  • gsave.txt
  • psave.txt
  • stats.txt

But I can't get /usr/local/bin/typon to use this location. And the application fails after /tmp is cleared.

I've tried running typon while in that new data directory as the current directory; that doesn't work.

I've also tried running typon -path ~/.local/share/typon just in the unlikely case that's a thing typon understands; it doesn't seem to. (typon -path still returns the now non-existent path it insist on trying to use.)

I can't find a user or system-wide typon config file that defines that path anywhere. Not anywhere under my user folder (named anything with "typon" or "ihsuy" in it), not anywhere under /etc, /usr, /var.

I've searched the source code to see if I can figure out how it's handling the path for those things (I'm sure that's figure-out-able, but I can't seem to.) I've found variables for storing them in save_handler[c|h]pp but not how they are set. It seems like I'm missing how/when/where the variable my_addr gets set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions