Re: How to use global and user related files?



Well. 

I'm answering to myself in hope that anybody corrects me if I'm wrong.
Also may be somebody is looking for the same questions in this list.:)

On Fri, 08 Apr 2005 20:23:37 +0400, Peter wrote:
> How to find user related dirrectory?

In pan (newsreader) sources I've found g_get_home_dir ().

> Also program may already have some data files in /usr/share/appname
> dirrectory, so I need to check the existance of file there and if I do not
> have file there create a new one in ~/.appname.

This is prorgam related. To look for files in /usr/share it's better to
write in makefile.am something like:

data_PROGRAMAME=list_of_files

INCLUDES=-DDATADIR=\"$(datadir)\"

And then in program path to look at should be (DATADIR"filename").
 
> To add users possibility to look for  files in dirrectories that may be
> mentioned in some environment variable (APPNAMEDIR="path1:path2").

There exist function g_getenv (); But does there exist simple and common
way to parse PATH variable?
 
Thank you for you attention,
Peter.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]