Glib::Utils(3)
🌸 Glib::Utils(3) — Miscellaneous utility functions 🌸
okay bestie, this page lives in the User Contributed Perl Documentation corner of manual-page world, and it’s literally your cheat sheet for GLib’s miscellaneous utility functions. 💖
✨ NAME ✨
Glib::Utils — Miscellaneous utility functions
🎀 SYNOPSIS 🎀
use Glib;
Glib::set_application_name (Glib::get_real_name."'s Cool Program");
print "app name is ".Glib::get_application_name()."\n";
🦋 DESCRIPTION 🦋
Here’s the cute little pile of useful miscellaneous utilities. GLib is a portability library, and it gives C programs portable utility functions. So yeah, most of these functions look like they’re out here violating 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 is available (POSIX provides similar information). They even work on platforms where %ENV may 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 $0. periodt. 💅
💜 METHODS 💜
string = Glib::get_application_name
Get the human-readable application name set by set_application_name.
Since: glib 2.2
Glib::set_application_name ($application_name)
$application_name(string)
Set the human-readable application name.
Since: glib 2.2
string = Glib::get_home_dir
Find the current user’s home directory, by system-dependent/appropriate means.
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".
Since: glib 2.6
string = Glib::get_prgname
Glib::set_prgname ($prgname)
$prgname(string)
string = Glib::get_real_name
Get the current user’s real name.
string = Glib::strerror ($err)
$err(integer)
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). slay for actually readable errors. ✨
string = Glib::strsignal ($signum)
$signum(integer)
Return a string describing the given signal number, like "Segmentation violation" for SIGSEGV. This is translated into the user’s preferred language and is a utf8 wide-char string.
list = Glib::get_system_config_dirs
Returns an ordered list of base directories in which to access system-wide configuration information.
Since: glib 2.6
list = Glib::get_system_data_dirs
Returns an ordered list of base directories in which to access system-wide application data.
Since: glib 2.6
string = Glib::get_tmp_dir
Get the temp dir as appropriate for the current system. See the GLib docs for info on how it works.
string = Glib::get_user_cache_dir
Gets the base directory in which to store non-essential, cached data specific to particular user.
Since: glib 2.6
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.
Since: glib 2.6
string = Glib::get_user_data_dir
Get the base directory for application data such as icons that is customized for a particular user.
Since: glib 2.6
string = Glib::get_user_name
Get the current user’s name by whatever system-dependent means necessary.
string = Glib::get_user_special_dir ($directory)
$directory(Glib::UserDirectory)
Returns the full path of a special directory using its logical id.
Since: glib 2.14
🌈 ENUMS AND FLAGS 🌈
enum Glib::UserDirectory
'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'
👑 SEE ALSO 👑
Glib
📜 COPYRIGHT 📜
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Glib for a full notice.
okay bestie, that’s the whole vibe. this iconic little page was brought to you by perl v5.42.0, dated 2023-09-05, and it was literally Glib::Utils(3). mwah 💋✨
📦 where this page comes from
- opensuse-leap 16.0: perl-Glib 1.3294-160000.2.2 · LGPL-2.1-or-later
- opensuse-leap 16.0: perl-Glib 1.3294-160000.2.2 · LGPL-2.1-or-later
- opensuse-leap 16.0: perl-Glib 1.3294-160000.2.2 · LGPL-2.1-or-later
- opensuse-leap 16.0: perl-Glib 1.3294-160000.2.2 · LGPL-2.1-or-later
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms