Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In which directories should I place the following?
I have an application with few .net assemblies, a default database (containing default application settings), a directory with 100's of images, a directory for sounds (e.g. mp3's).

e.g.

somedir/myapp.exe  
somedir/myassembly1.dll  
somedir/myassembly2.dll  

somedir/images/1/image1.png  
somedir/images/1/image2.png  
somedir/images/2/image1.png  

somedir/sounds/1/sound1.mp3  
somedir/sounds/1/sound2.mp3  
somedir/sounds/2/sound1.mp3  

A requirement is that I want to allow my user to replace the sounds and images as they see fit so basically that path (e.g. /var or /usr) should typically have write access to a normal user.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

If your application needs to be modifiable by a user, you should not be installing it to the system but have them do some kind of local-install to their user home folder. $HOME/yourapp/{bin,images,sounds} etc.

Most system paths like /var, /usr, are not and should not be write accessible by users.

The alternative is to install your app normally, but create a sort of overlay in $HOME/.yourapp that includes all the things the user has changed that are different from the system defaults.

share|improve this answer
    
+1 for the overlay approach. The application can look in $HOME first, and in the system path if the file isn't found. –  André Paramés May 10 '11 at 12:30

You could follow the XDG Base Directory Specification and place the user-replacable stuff in a directory in $XDG_DATA_HOME and any user configuration files in a directory in $XDG_CONFIG_HOME (which default to $HOME/.local/share/ and $HOME/.config/ respectively).

I'm not sure this can be called the standard way of doing things yet but it's certainly popular, so your users will likely be familiar with it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.