Forum > General
Where to save a file so that it cane be easily accessed ??
(1/1)
newman:
Hello,
I have a question regarding applicaion development in Linux.
My problem is that I need to store a file in a commonly accessible location, so that different applications can access it.
In windows programming the file could be stored in the systems folder.
Since the path to the systems folder was easily retrieved using an API, applications could easily use this API and get the path.
Is there such a folder in Linux (Ubuntu 9.10) which could be easily accessed by any application.
Thanks
ne
theo:
http://www.freepascal.org/docs-html/rtl/sysutils/getappconfigdir.html
Do you mean "any user" or "any application"?
S.a.: http://tldp.org/LDP/intro-linux/html/sect_03_01.html#sect_03_01_03_01
Troodon:
Any user and application can open in read mode pretty much any file or directory (except in other user's home directories and a few other locations). If you need write access, your application installer could create a new directory such as /share/<your_app> or /opt/<your_app> and grant R/W access to it to all users. The installer (or package manager, such as apt/synaptic etc.) usually runs with admin privileges. But keep in mind that, if several users can access a particular file in write mode then your application should be able to avoid race conditions. A database system is a better option for concurrent access to data.
newman:
I meant any application.
The GetAppConfigDir looks ideal. I think this can work for me..
Thanks all
Navigation
[0] Message Index