Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hard-coding paths in Linux

Coming from Windows background here.

Is it an acceptable practice for GUI Linux applications to store their data files (not user-specific) at hard-coded locations (e. g. /etc/myapp/stuff)? I couldn't find any syscalls that would return the preferred directory for app data. Is there a convention out there as to what goes where?

like image 293
Seva Alekseyev Avatar asked Sep 16 '10 17:09

Seva Alekseyev


1 Answers

/opt/appname/stuff according to the Linux Filesystem Hierarchy Standard

Your distribution's packaging system likely provides ways to handle common installation paths. What distribution are you using?

like image 145
Joe Koberg Avatar answered Sep 27 '22 22:09

Joe Koberg