Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadTable should accept a path #70

Open
epineapple opened this issue Feb 19, 2020 · 4 comments
Open

ReadTable should accept a path #70

epineapple opened this issue Feb 19, 2020 · 4 comments

Comments

@epineapple
Copy link
Contributor

The ReadTable function currently expects to write a large file to the user's home directory. This interface should change (or a new interface added) to allow for the specification of a different directory. This makes sense for several reasons:

  1. If LXRHash is used in a daemon or service, there may not be a home directory to use.
  2. It would be nice to share these files between all users on a system.
  3. The user may wish to store the file on a faster medium than that which stores the user's home directory.

I'm happy to submit a PR if one is welcome.

@Emyrk
Copy link
Member

Emyrk commented Feb 19, 2020

This is a valid request. I would not like to make a breaking API change.

We should create a new function that allows the change of the LXR hash table location. Perhaps even allow an environment variable to change the location so all applications will respect it?

@epineapple
Copy link
Contributor Author

I would be open to an environment variable, e.g., LXRHASH_TABLEPATH. I also think that LXRHash should specify a shared system-wide location, such as /var/lib/LXRHash or /var/opt/LXRHash on *NIX, C:\ProgramData\LXRHash on Windows and /Library/Application Support/org.pegnet.LXRHash on macOS. This would make it easier for applications using LXRHash to select a common path.

@Emyrk
Copy link
Member

Emyrk commented Feb 26, 2020

Moving the location is reasonable, but we have already made docker containers and externals apps with the home path. I think adding an environment variable would be flexible. Any PR to do that would likely be accepted

@epineapple
Copy link
Contributor Author

We can do an environment variable.

Just so you're aware of what that will mean for a Windows service using LXRHash, the service may need to have the environment variable set in the registry. If that's the case, then any changes will require a reboot. (I've not yet tested whether the service can simply set the environment variable once it starts, as a hacky way of passing the variable.)

https://docs.microsoft.com/en-us/windows/win32/services/service-startup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants