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

Make the linux version aware of its installation path #52

Open
tribad opened this issue Jul 3, 2018 · 4 comments
Open

Make the linux version aware of its installation path #52

tribad opened this issue Jul 3, 2018 · 4 comments

Comments

@tribad
Copy link
Contributor

tribad commented Jul 3, 2018

For linux builds it would be no problem to find the path to the place from where the parsec application has been started.
Because this may be usefull for the server as well it would be part of the libparsec. Whether a new modul gets created or the function get incorporated into some existing modules is not clear at the moment

With the solution I would add some classes I developed a long time ago to handle filenames/directories and files in a in-between way more like parsec inventors did. They use the standard C-library functions and define some sort of encapsulation of these function.

Whether these functions are going to be used in the future is up to you.

Anyway. Looking up the location the executed binary is from is done via the /proc filesystem and very linux specific. But it will be the base for any location specific file access.

@CrazySpence
Copy link
Member

Probably a good idea to have the linux bin search common path locations ./ , /usr/share/openparsec, ~/.openparsec/ that sort of thing like other games do if we want people to be able to make distro packages for thing

@uberlinuxguy
Copy link
Member

One thing it needs to do is write parsecrc.con to a user home dir. That file stores the user's prefs and is pretty bad if it can't write it out. A useful default would be good too

@slime73
Copy link
Member

slime73 commented Dec 8, 2021

For a guaranteed writable path for settings, SDL_GetPrefPath seems like it'd be useful.

@tribad
Copy link
Contributor Author

tribad commented Dec 8, 2021

SDL_GetPrefPath() seems ok for the user-config directory.
The installation path is a usefull information to create an absolut path to config files or what ever is needed to access at runtime.
On a linux machine this could be found through the /proc/ proc-pid /exe
The benefit of that approach would be that you find the executable even if the user created a link to the executable and used that for starting the application.

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

4 participants