Package: glib

Function g-user-special-dir

Lambda List

g-user-special-dir (directory)

Arguments

directory -- the g-user-directory logical ID of special directory

Return Value

A string with the path to the specified special directory, or nil if the logical ID was not found. The returned string is owned by GLib and should not be modified or freed.

Details

Returns the full path of a special directory using its logical ID.

On Unix this is done using the XDG special user directories. For compatibility with existing practise, :desktop falls back to $HOME/Desktop when XDG special user directories have not been set up.

Depending on the platform, the user might be able to change the path of the special directory without requiring the session to restart. GLib will not reflect any change once the special directories are loaded.

Examples

  (g-user-special-dir :documents)
=> "/home/dieter/Dokumente"
  (g-user-special-dir :download)
=> "/home/dieter/Downloads"    
 

See also

2020-10-23