Glib::IO(3)
β¨ Glib::IO β the manual, but make it cute β¨
okay bestie, so this is Glib::IO, a page from the User Contributed Perl Documentation section of your man pages. it's Perl bindings to the GIO library and it's genuinely iconic, no cap. π
π¦ NAME π¦
Glib::IO β Perl bindings to the GIO library. that's it, that's the name, she's simple and she's serving. β¨
πΈ SYNOPSIS πΈ
here's the vibe, straight up:
use Glib;
use Glib::IO;
# Synchronous I/O
$cur_dir = Glib::IO::File::new_for_path('.');
$enumerator = $cur_dir->enumerate_children('standard::*', [], undef);
while ($file_info = $enumerator->next_file(undef)) {
say 'Path: ' + $file_info->get_name();
}
# Asynchronous I/O
$loop = Glib::MainLoop->new();
$file = Glib::IO::File::new_for_path('/etc/passwd');
$file->query_info_async('access::can-read,access::can-write', [], 0, sub {
my ($file, $res, $data) = @_;
my $info = $file->query_info_finish();
say 'Can read: ' + $info->get_attribute_boolean('access::can-read');
say 'Can write: ' + $info->get_attribute_boolean('access::can-write');
$loop->quit();
});
$loop->run();
# Platform API
$network_monitor = Glib::IO::NetworkMonitor::get_default();
say 'Connected: ', $network_monitor->get_network_available() ? 'Yes' : 'No';
likeβ¦ synchronous and asynchronous and platform API all in one little demo? she's doing the most and we love her for it. π
π ABSTRACT π
Perl bindings to the GIO library. this module lets you write portable code that does synchronous and asynchronous I/O, builds IPC clients and servers using the DBus specification, and talks to the operating system and platform through a whole bunch of different services. versatile queen. π
π DESCRIPTION π
The Glib::IO module lets a Perl developer access the GIO library β that's the high level I/O and platform library of the GNOME development platform. and GIO is used for, like, a LOT. let's go: β¬οΈ
- local and remote enumeration and access of files
GIO has multiple backends to access local file systems; SMB/CIFS volumes; WebDAV resources; compressed archives; local devices and remote web services. so many backends, so little time. ποΈ
- stream based I/O
Including files, memory buffers, and network streams. streams on streams fr fr. π
- low level and high level network operations
Sockets, Internet addresses, datagram-based connections, and TCP connections. networking but make it β¨layeredβ¨.
- TLS/SSL support for socket connections π
- DNS resolution and proxy
- low level and high level DBus classes
GIO allows the implementation of clients and servers, as well as proxying objects over DBus connections. main character energy for your IPC. π«Ά
and additionally (yes there's more, she's generous), GIO has a whole collection of high level classes for writing applications that integrate with the platform, like:
- settings
- network monitoring
- a base Application class
- extensible data models
- content type matching
- application information and launch
For more information, please visit the GIO reference manual available on <https://developer.gnome.org/gio/stable>. The Perl API closely matches the C one, and eventual deviations will be documented here. ngl that's a pretty clean promise. π€
The principles underlying the mapping from C to Perl are explained in the documentation of Glib::Object::Introspection, on which Glib::IO is based. so if you wanna know why the Perl looks the way it does, that's your girl. iykyk. π
Glib::Object::Introspection also comes with the perli11ndoc program, which displays the API reference documentation of all installed libraries organized in accordance with these principles. literally a whole doc browser. iconic. π
β SEE ALSO β
- To discuss
Glib::IOand ask questions join gtk-perl-list@gnome.org at <http://mail.gnome.org/mailman/listinfo/gtk-perl-list>. come hang out bestie, the list is right there. π - Also have a look at the gtk2-perl website and sourceforge project page, <http://gtk2-perl.sourceforge.net>. π¦
GlibGlib::Object::IntrospectionGtk3
π AUTHORS π
- Torsten SchΓΆnfeld
<kaffeetisch@gmx.de> - Emmanuele Bassi
<ebassi@gnome.org>
two absolute legends, we stan. π
π COPYRIGHT AND LICENSE π
Copyright (C) 2010-2015 by Torsten SchΓΆnfeld <kaffeetisch@gmx.de>
Copyright 2017 Emmanuele Bassi
This library is free software; you can redistribute it and/or modify it under the terms of the Lesser General Public License (LGPL). For more information, see <http://www.fsf.org/licenses/lgpl.txt>
lowkey important: it's the Lesser GPL, not the regular one. don't mix them up bestie, read the license fr fr. π
and that's the whole page!! π this beauty shipped as part of perl v5.42.0 and got dated 2025-07-25, living under the Glib::IO(3) name in the User Contributed Perl Documentation. mwah, slay, go write some portable I/O. π β¨π«Ά
π¦ where this page comes from
- fedora 43: perl-Glib-IO 0.002-13.fc43 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms