Pregunta

I am developing a podcast application, and I have to store the urls / paths of the podcast RSS files somehow on the hard disk to be able to restore them between appication restarts. I thought about using .ini or .csv files, and my question is, where do such files go on a Linux filesystem and on a Windows filesystem ? I know that normal configuration files that contain font size, font family etc. go into /etc on Linux, but I thought it wouldn't be appropriate to put the file cotaining the RSS file list there, too, as it isn't really a configuration files. Should I put them there in spite of my doubts, or create a hidden directory containg that list file in the users home folder, or where should this file be put ? I really have no idea ...

¿Fue útil?

Solución

I'd suggest you use home directory of the current user.

On Linux, you can determine it via environment variable HOME. On Windows via environment variable USERPROFILE or, better, via APPDATA (corresponds to ...\AppData\Roaming) or LOCALAPPDATA (corresponds to ...\AppData\Local). Create a directory there which indicates your application name or company as directory and application as a subdirectory. Look how widely known applications do that, like FireFox or Chrome.

This approach has following advantages:

  • User has write access to this directory. No special permissions need to be configured, compared to some common directories like "/etc" on Linux.
  • If more than one user uses this application, their data will not be mixed.
  • Data stored below user home directory are not accessible to other users. Thus you can have better privacy.
Licenciado bajo: CC-BY-SA con atribución
scroll top