Glib::IO(3)

πŸ“¦
version 0.002 Β· 2 versions
, in fedora 43

✨ 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 ⭐


πŸ‘‘ AUTHORS πŸ‘‘

  • Torsten SchΓΆnfeld <kaffeetisch@gmx.de>
  • Emmanuele Bassi <ebassi@gnome.org>

two absolute legends, we stan. πŸ™Œ


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