Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-12

GetAppConfigDir but for temp data?

17 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

GetAppConfigDir(False) returns a directory location where local config information about an application can be store. Is there one for local data? Or is the recommendation (from FreeDesktop.org or Microsoft etc..) that it's okay to use the local config directory for data as well?

eg:
I have an app that creates a database to store collected information and input from the user. I would normally not associate that as a "config" file, but rather "data". I currently use the config directory for things like "last opened file", "last user search", window positions etc... that I consider "config" information, but not the local database.

I believe Microsoft has a LocalAppData location, but not sure if that is also used for GetAppConfigDir(False).

For example: freedesktop.org (I believe) specifies the following file: $HOME/.config/user-dirs.dirs
Which on my system contains the following information. Unfortunately it doesn't have something as clear as "application data" location, though I might consider XDG_DOCUMENTS_DIR as a suitable location. eg: $XDG_DOCUMENTS_DIR/<appname>/[data goes here]

Any suggestions?

------------------------[ user-dirs.dirs ]------------------------------- # This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're # interested in. All local changes will be retained on the next run # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/downloads/unsorted"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"
-------------------------------[ end ]-----------------------------

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 18 lines
Hi, GetAppConfigDir(False) returns a directory location where local config information about an application can be store. Is there one for local data? Or is the recommendation (from FreeDesktop.org or Microsoft etc..) that it's okay to use the local config directory for data as well? eg: I have an app that creates a database to store collected information and input from the user. I would normally not associate that as a "config" file, but rather "data". I currently use the config directory for things like "last opened file", "last user search", window positions etc... that I consider "config" information, but not the local database. I believe Microsoft has a LocalAppData location, but not sure if that is also used for GetAppConfigDir(False).

Yes it is.

Show quoted text 7 lines
For example: freedesktop.org (I believe) specifies the following file: $HOME/.config/user-dirs.dirs Which on my system contains the following information. Unfortunately it doesn't have something as clear as "application data" location, though I might consider XDG_DOCUMENTS_DIR as a suitable location. eg: $XDG_DOCUMENTS_DIR/<appname>/[data goes here]

Well, on my system this file does not exist.

It's not so easy to find a good compromise.

I was already not very happy about the change to use ~/.config/appname instead of .appname.

The fact that the freedesktop.org specs are not very binding, doesn't make it very suitable in my eyes. I'd rather use the 'established' unix customs of using ~/.appname and e.g. /tmp or so.

But I am open for suggestions.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt
Michael Van Canneyt wrote
> I believe Microsoft has a LocalAppData location, but not sure if that > is also used for GetAppConfigDir(False). Yes it is.

Umm... :-(

> For example: freedesktop.org (I believe) specifies the following file: > $HOME/.config/user-dirs.dirs Well, on my system this file does not exist.

I can't remember ever installing it myself, but it seems to be included as part of the following Ubuntu (deb) packages:
* xdg-user-dirs
* xdg-user-dirs-gtk

Which also has defaults in the following locations: /etc/xdg/user-dirs.conf
/etc/xdg/user-dirs.defaults

More info here:
http://www.freedesktop.org/wiki/Software/xdg-user-dirs

I don't know which applications actually adhere to these locations though, but I'm willing to start. :-)

It's not so easy to find a good compromise.

I agree, hence my posting here... ;-)

I was already not very happy about the change to use ~/.config/appname instead of .appname.

Oh, I welcomed that change. :-) I hate having my $HOME directory full of hidden files and directories. It's to disorganised for my liking.

The fact that the freedesktop.org specs are not very binding, doesn't make it very suitable in my eyes.

Well at least they are trying to making things easier for desktop applications. Using things like 'xdg-open' instead of trying to find the correct user preferred application to open HTTP, text files, HTML, PDF etc... files. It's a huge time saver! I wish more and more applications will start following these guidelines. Unix and Linux systems really need some consistency in the desktop application space.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 28 lines
On Wed, Dec 3, 2008 at 2:40 PM, Michael Van Canneyt wrote: >> I believe Microsoft has a LocalAppData location, but not sure if that >> is also used for GetAppConfigDir(False). > > Yes it is. Umm... :-( >> For example: freedesktop.org (I believe) specifies the following file: >> $HOME/.config/user-dirs.dirs > > Well, on my system this file does not exist. I can't remember ever installing it myself, but it seems to be included as part of the following Ubuntu (deb) packages: * xdg-user-dirs * xdg-user-dirs-gtk Which also has defaults in the following locations: /etc/xdg/user-dirs.conf /etc/xdg/user-dirs.defaults More info here: http://www.freedesktop.org/wiki/Software/xdg-user-dirs I don't know which applications actually adhere to these locations though, but I'm willing to start. :-)

On a KDE system: none.

gru: >ls /etc/xdg/user-dirs.conf
ls: /etc/xdg/user-dirs.conf: No such file or directory

Show quoted text 21 lines
> It's not so easy to find a good compromise. I agree, hence my posting here... ;-) > I was already not very happy about the change to use ~/.config/appname > instead of .appname. Oh, I welcomed that change. :-) I hate having my $HOME directory full of hidden files and directories. It's to disorganised for my liking. > The fact that the freedesktop.org specs are not very binding, doesn't > make it very suitable in my eyes. Well at least they are trying to making things easier for desktop applications. Using things like 'xdg-open' instead of trying to find the correct user preferred application to open HTTP, text files, HTML, PDF etc... files. It's a huge time saver! I wish more and more applications will start following these guidelines. Unix and Linux systems really need some consistency in the desktop application space.

Well, KDE is a good standard as far as I'm concerned.

Everything is in - more or less - logical places, and it's very well standardized.

But it is not the freedesktop standard....

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt
Michael Van Canneyt wrote
> I don't know which applications actually adhere to these locations > though, but I'm willing to start. :-) On a KDE system: none.

:-) Like I said, Linux has a long way to go for desktop friendly apps.

Well, KDE is a good standard as far as I'm concerned. Everything is in - more or less - logical places, and it's very well standardized.

And a LOT more consistent in it's UI compared to Gnome. Not to mention that the "your a dumb user so we need to hide everything" approach of Gnome is absolutely absurd. I have KDE installed, but I simply can't switch to it due to the "lazarus gets minimized when switching desktops" bug. That drives me bonkers, so I'll stay with Gnome dekstop for now. :-( Until Graeme's clone #55 finishes his new Window Manager written in fpGUI. :-)
[http://sourceforge.net/projects/fpwm/]

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gärtner
to Graeme Geldenhuys

Zitat von Graeme Geldenhuys :

Show quoted text 9 lines
On Wed, Dec 3, 2008 at 6:36 PM, Michael Van Canneyt wrote: >> I don't know which applications actually adhere to these locations >> though, but I'm willing to start. :-) > > On a KDE system: none. :-) Like I said, Linux has a long way to go for desktop friendly apps.

desktop friendly mono culture

[...]

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gärtner
Mattias Gärtner wrote
> > :-) Like I said, Linux has a long way to go for desktop friendly apps. desktop friendly mono culture

I don't understand? What I meant by "dekstop friendly apps" is.... Take a simple example. Under Windows you are guaranteed that if you want to show a user a readme.txt file, you can call notepad.exe and the filename (yes I know you can do it in other ways too, but I did say this example is simple.). Under linux, how do you know the users favorite text editor? You can't assume 'gEdit', because they might run KDE. Oh, you can't even assume 'kate' because they could be running FVWM. When writing desktop applications there are lots of such cases under Linux. That's why I welcome any standardization under Linux, which desktop app developers can use. eg: xdg-open but clearly xdg is not on all distros. :-(

I'm clearly not the only one thinking like this. That's also why Gnome and KDE themes are more interchangable. You can run KDE apps under Gnome, and they blend in quite nicely. Years ago, they didn't.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gärtner
to Graeme Geldenhuys

Zitat von Graeme Geldenhuys :

Show quoted text 12 lines
On Wed, Dec 3, 2008 at 6:56 PM, Mattias Gärtner wrote: >> >> :-) Like I said, Linux has a long way to go for desktop friendly apps. > > desktop friendly mono culture I don't understand? What I meant by "dekstop friendly apps" is.... Take a simple example. Under Windows you are guaranteed that if you want to show a user a readme.txt file, you can call notepad.exe and the filename (yes I know you can do it in other ways too, but I did say this example is simple.).

notepad.exe has problems with non windows line ends.

Under linux, how do you know the users favorite text editor?

To show a readme.txt you don't need to open the favorite text editor. A browser could do the same.

Show quoted text 6 lines
You can't assume 'gEdit', because they might run KDE. Oh, you can't even assume 'kate' because they could be running FVWM. When writing desktop applications there are lots of such cases under Linux. That's why I welcome any standardization under Linux, which desktop app developers can use. eg: xdg-open but clearly xdg is not on all distros. :-(

Some don't even have X.

I'm clearly not the only one thinking like this. That's also why Gnome and KDE themes are more interchangable. You can run KDE apps under Gnome, and they blend in quite nicely. Years ago, they didn't.

We had this discussions already. So, yes and no. ;)

Mattias

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys: On Wed, Dec 3, 2008 at 6:36 PM, Michael Van Canneyt :-) Like I said, Linux has a long way…
Graeme Geldenhuys wrote 24 lines
On Wed, Dec 3, 2008 at 6:36 PM, Michael Van Canneyt wrote: >> I don't know which applications actually adhere to these locations >> though, but I'm willing to start. :-) > > On a KDE system: none. :-) Like I said, Linux has a long way to go for desktop friendly apps. > Well, KDE is a good standard as far as I'm concerned. > > Everything is in - more or less - logical places, and it's > very well standardized. And a LOT more consistent in it's UI compared to Gnome. Not to mention that the "your a dumb user so we need to hide everything" approach of Gnome is absolutely absurd. I have KDE installed, but I simply can't switch to it due to the "lazarus gets minimized when switching desktops" bug. That drives me bonkers, so I'll stay with Gnome dekstop for now. :-( Until Graeme's clone #55 finishes his new Window Manager written in fpGUI. :-) [http://sourceforge.net/projects/fpwm/]

I don't want to spoil anyones fun - even the fun of a clone - but it seems to me that solving the lazarus problem is considerably less work than writing a full-blown window manager :-)

Michael.

Reply by email

Marco van de Voort
to Graeme Geldenhuys: On Wed, Dec 3, 2008 at 6:56 PM, Mattias Gärtner I don't understand? What I meant by…

In our previous episode, Graeme Geldenhuys said:

Show quoted text 12 lines
On Wed, Dec 3, 2008 at 6:56 PM, Mattias G?rtner wrote: >> >> :-) Like I said, Linux has a long way to go for desktop friendly apps. > > desktop friendly mono culture I don't understand? What I meant by "dekstop friendly apps" is.... Take a simple example. Under Windows you are guaranteed that if you want to show a user a readme.txt file, you can call notepad.exe and the filename (yes I know you can do it in other ways too, but I did say this example is simple.).

That would be a bad experience for me, since I have registered .txt with notepad plus, not notepad.

So it is not proper windows behaviour.

Reply by email

Michael Schneider
to Vinzent Höfler
Vinzent Höfler wrote
Graeme Geldenhuys wrote: > Under linux, how do you know the users > favorite text editor?

For the 2 common DEs
KDE3
http://developer.kde.org/documentation/library/kdeqt/kde3arch/mime.html

Gnome
http://library.gnome.org/devel/gnome-vfs-2.0/unstable/gnome-vfs-20-gnome-vfs-mime-database.html#GnomeVFSMimeApplication

A (KDE)solution from Theo (sorry in german)
http://www.lazarusforum.de/viewtopic.php?f=12&t=1382&st=0&sk=t&sd=a&start=15

Reply by email

Graeme Geldenhuys
to Mattias Gärtner: Zitat von Graeme Geldenhuys : notepad.exe has problems with non windows line ends. To…
Mattias Gärtner wrote
notepad.exe has problems with non windows line ends.

Yes I know, but that's besides the point. Windows has ShellExecute which handle the file association for you. Linux doesn't.

Show quoted text 5 lines
> Under linux, how do you know the users > favorite text editor? To show a readme.txt you don't need to open the favorite text editor. A browser could do the same.

That just moves the issue to another application. How do you know the users favorite browser. eg: When I use Gnome apps like Nautilus, it opens my favorite browser Firefox. When I use a KDE application inside Gnome, it uses Konqueror. When I use Midnight Commander (text based file manager) inside a terminal window and press enter on a HTML file, it also opens Konqueror.

These are all inconsistencies, which they need to resolve for desktop apps to truly take off in the Linux environment.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Luca Olivetti
Luca Olivetti wrote
> These are all inconsistencies, which they need to resolve for desktop > apps to truly take off in the Linux environment. http://portland.freedesktop.org

:-) I know about that, and that is exactly what I am talking about. I just which the uptake increases in many more distros.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Luca Olivetti
to Graeme Geldenhuys

En/na Graeme Geldenhuys ha escrit:

Show quoted text 7 lines
On Thu, Dec 4, 2008 at 3:52 PM, Luca Olivetti wrote: >> These are all inconsistencies, which they need to resolve for desktop >> apps to truly take off in the Linux environment. > http://portland.freedesktop.org :-) I know about that, and that is exactly what I am talking about. I just which the uptake increases in many more distros.

You could also follow the advice un the "Using Xdg-Utils" section (i.e. bundle a copy of those scripts with your application but put them last in the path).

Bye

Luca

Reply by email

Graeme Geldenhuys
to Luca Olivetti
Luca Olivetti wrote
You could also follow the advice un the "Using Xdg-Utils" section (i.e. bundle a copy of those scripts with your application but put them last in the path).

Luckily we have pretty good control over our deployment environment and recommend Ubuntu to all our franchisees. As far as I know, xdg-utils come standard with Ubuntu. But for safety sake, we will definitely deploy the xdg-utils as well. Anything to help promote the idea for better desktop applications on Linux.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email