Section: User Contributed Perl Documentation (3pm)
use Glib; Glib::set_application_name (Glib::get_real_name."'s Cool Program"); print "app name is ".Glib::get_application_name()."\n";
DESCRIPTIONHere are some useful miscellaneous utilities. GLib is a portability library, providing portable utility functions for C programs. As such, most of these functions seem to violate the Glib binding principle of not duplicating functionality that Perl already provides, but there's a distinction for each one, i swear. The functions for dealing with user information are provided on all GLib-supported platforms, not just where POSIX (which provides similar information) is available, and even work on platforms where
%ENVmay not include the expected information. Also, the ``application name'' referred to by (set|get)_application_name is a human readable name, distinct from the actual program name provided by Perl's own
string = Glib::get_application_nameGet the human-readable application name set by
Set the human-readable application name.
string = Glib::get_home_dir
list = Glib::get_language_names
Computes a list of applicable locale names, which can be used to e.g. construct locale-dependent filenames or search paths. The returned list is sorted from most desirable to least desirable and always contains the default locale ``C''.
string = Glib::get_real_name
string = Glib::strerror ($err)
Return a string describing the given errno value, like ``No such file or directory'' for ENOENT. This is translated into the user's preferred language and is a utf8 wide-char string (unlike a $! string (perlvar) or POSIX::strerror (POSIX) which are locale codeset bytes).
string = Glib::strsignal ($signum)
list = Glib::get_system_config_dirs
Returns an ordered list of base directories in which to access system-wide configuration information.
list = Glib::get_system_data_dirs
Returns an ordered list of base directories in which to access system-wide application data.
string = Glib::get_tmp_dir
string = Glib::get_user_cache_dir
Gets the base directory in which to store non-essential, cached data specific to particular user.
string = Glib::get_user_config_dir
Gets the base directory in which to store user-specific application configuration information such as user preferences and settings.
string = Glib::get_user_data_dir
Get the base directory for application data such as icons that is customized for a particular user.
string = Glib::get_user_name
string = Glib::get_user_special_dir ($directory)
Returns the full path of a special directory using its logical id.
ENUMS AND FLAGS
- 'desktop' / 'G_USER_DIRECTORY_DESKTOP':
- 'documents' / 'G_USER_DIRECTORY_DOCUMENTS':
- 'download' / 'G_USER_DIRECTORY_DOWNLOAD':
- 'music' / 'G_USER_DIRECTORY_MUSIC':
- 'pictures' / 'G_USER_DIRECTORY_PICTURES':
- 'public-share' / 'G_USER_DIRECTORY_PUBLIC_SHARE':
- 'templates' / 'G_USER_DIRECTORY_TEMPLATES':
- 'videos' / 'G_USER_DIRECTORY_VIDEOS':
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Glib for a full notice.