Device...0::IFS(3pm)
πΏ Device::Cdio::ISO9660::IFS β the ISO 9660 filesystem image reader πΏ
okay bestie, quick vibe check: this page lives in the User Contributed Perl Documentation section, and it's filed under the 3pm manual. It's your girl for reading ISO 9660 filesystem images. Let's get into it π«Ά
β¨ NAME β¨
Device::Cdio::ISO9660::IFS β a whole class dedicated to reading ISO 9660 filesystem images. she reads, she parses, she serves π
β¨ SYNOPSIS β¨
So here's the tea: this class encapsulates all the ISO 9660 filesystem image handling, and bestie, you'll usually run it alongside Device::Cdio::ISO9660. They're a duo. Dynamic duo. Iconic.
use Device::Cdio::ISO9660;
use Device::Cdio::ISO9660::IFS;
$iso = Device::Cdio::ISO9660::IFS->new(-source=>'copying.iso');
my $id = $iso->get_application_id();
$id = $iso->get_preparer_id();
$id = $iso->get_publisher_id();
$id = $iso->get_system_id();
$id = $iso->get_volume_id();
$id = $iso->get_volumeset_id();
my $path = '/';
@file_stats = $iso->readdir($path);
foreach my $href (@file_stats) {
printf "%s [LSN %6d] %8d %s %s%s\n",
$href->{is_dir} ? "d" : "-",
$href->{LSN}, $href->{size},
$href->{tm}->{year},
$path,
Device::Cdio::ISO9660::name_translate($href->{filename});
}
β¨ DESCRIPTION β¨
This is an Object-Oriented interface to the GNU CD Input and Control library, a.k.a. libcdio, which is written in C. This class handles the ISO 9660 aspects of an ISO 9600 image. Yes, that's the actual spelling in the source. We don't question it, we respect it π
Now, important distinction time, because the way people mix these up is giving chaos:
An ISO-9660 image is not the same thing as a CD in a CD-ROM that happens to have ISO-9660 tracks on it. That second one has extra CD-flavoured info (tracks, info, stuff associated with the CD itself). An ISO-9660 filesystem image, on the other hand, does not have any of that. It's generally just a file sitting in some file system, sometimes with the extension .iso. Maybe you can burn it into a CD with a suitable tool, maybe you can "mount" it as a filesystem on some OSes. Either way, it's a file. A little image file. Living her life πΈ
π CALLING ROUTINES π
Routines accept named parameters and positional parameters. Both. She's flexible like that β¨
For named parameters, each argument name gets a dash in front of it. Like so:
Device::Cdio::ISO9660::IFS->new(-source=>'MYISO.ISO')
Every argument name is preceded by a dash. Neither case nor order matters in the argument list β -driver_id, -Driver_ID, and -DRIVER_ID are all totally acceptable. And honestly? Only the first argument needs to begin with a dash. If there's a dash in the first argument, we just assume dashes for all the subsequent parameters. Trust fall π€
In the documentation below and elsewhere in this package, the parameter name you'd use in this style of call is given in the parameter list. For example, for open the docs below read:
open(source, iso_mask=$pyiso9660::EXTENSION_NONE)->bool
So the parameters are source and is_mask. The iso_mask parameter is not required, and if you don't specify it, a value of $perliso9660:EXTENSION_NON will be used. (Yes, that's what it says. Copying it exactly, bestie, that's the whole job π)
The older, more traditional style of positional parameters is also supported. So the have_driver example from above can also be written as:
Cdio::open($s, $i)
And finally β since no parameter name can be confused with an integer, negative values will not get confused as a named parameter. Small mercy, we love to see it π
β¨ METHODS β¨
β new
new(source, iso_mask)->$iso9660_object
Create a brand new ISO 9660 object. Source or iso_mask is optional, no pressure π«Ά
If source is given, open() gets called with that plus the optional iso_mask parameter; iso_mask is only used if source is specified. If source is given but the opening fails, undef comes back to you. If source isn't given at all, you always get an object back. Guaranteed. Periodt.
β close
close()->bool
Close a previously opened ISO 9660 image and free up the resources associated with ISO9660. Call this when you're done using an ISO 9660 image. Like closing your tabs. You should do it. You won't, but you should π
β find_lsn
find_lsn(lsn)->$stat_href
Find the filesystem entry that contains LSN and return file stat info about it. If something goes sideways, undef is returned.
β get_application_id
get_application_id()->$id
Grab the application ID stored in the Primary Volume Descriptor. undef gets returned if there's some problem.
β get_preparer_id
get_preparer_id()->$id
Grab the preparer ID stored in the Primary Volume Descriptor. undef gets returned if there's some problem.
β get_publisher_id
get_publisher_id()->$id
Grab the publisher ID stored in the Primary Volume Descriptor. undef gets returned if there's some problem.
β get_root_lsn
get_root_lsn()->$lsn
Grab the Root LSN stored in the Primary Volume Descriptor. undef gets returned if there's some problem.
β get_system_id
get_system_id()->$id
Grab the Volume ID stored in the Primary Volume Descriptor. undef gets returned if there's some problem.
β get_volume_id
get_volume_id()->$id
Grab the Volume ID stored in the Primary Volume Descriptor. undef gets returned if there's some problem.
β get_volumeset_id
get_volume_id()->$id
Grab the Volume ID stored in the Primary Volume Descriptor. undef gets returned if there's some problem.
β open
open(source, iso_mask=$perliso9660::EXTENSION_NONE)->bool
Open an ISO 9660 image for reading. All the subsequent operations will read from this ISO 9660 image. She's locked in π₯
This should be called before you use any other routine β except possibly new. It's implicitly called when a new is done specifying a source.
If the device object was previously opened, it gets closed first. Out with the old, in with the new β¨
See also open_fuzzy.
β open_fuzzy
open_fuzzy(source, iso_mask=$perliso9660::EXTENSION_NONE, fuzz=20)->bool
Open an ISO 9660 image for reading. Subsequent operations read from this ISO 9660 image. Some tolerance is allowed for positioning the ISO9660 image β we scan for $perliso9660::STANDARD_ID and use that to set the eventual offset to adjust by, as long as that's <= $fuzz. Fuzzy in a cute way. Fuzzy in a tolerant way π
This should be called before using any other routine except possibly new (which must be called first). It is implicitly called when a new is done specifying a source.
See also open.
β read_fuzzy_superblock
read_fuzzy_superblock(iso_mask=$perliso9660::EXTENSION_NONE,
fuzz=20)->bool
Read the Super block of an ISO 9660 image, but figure out framesize and datastart and a possible additional offset. Generally, here we are not reading an ISO 9660 image but a CD-Image that contains an ISO 9660 filesystem. Sneaky little container π
β readdir
readdir(dirname)->@iso_stat
Read a path (a directory) and return a list of iso9660 stat references. So many references. All of them. She's handing you a whole list π
See stat_array_to_href in Device::Cdio::ISO9660 for the description of each hash reference in the @stat that gets returned.
If you peek inside iso9660.h you'll see more fields, like the Rock-Ridge specific fields or the XA specific fields. Volunteers? π (That's literally what it asks. We're passing the message along, bestie.)
β read_pvd
read_pvd()->pvd
Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable. Two descriptors for the price of one, when Joliet's in the chat π
β read_superblock
read_superblock(iso_mask=$perliso9660::EXTENSION_NONE)->bool
Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable. Yeah, same energy as read_pvd, love that for them π«Ά
β seek_read
seek_read(start, size=1)->(size, str)
Seek to a position and then read n bytes. The size that was read is returned. Point, shoot, read π―
β stat
stat(path, translate=0)->\%stat
Return the file status for the path name psz_path. undef gets returned on error.
If translate is 1, version numbers in the ISO 9660 name get dropped β i.e. ;1 is removed β and if they're level 1 ISO-9660 names, they get lowercased. Glow-down β¨
See stat_array_to_href in Device::Cdio::ISO9660 for the description of the \%stat hash reference that gets returned.
β¨ SEE ALSO β¨
See also Device::Cdio for module information, Device::Cdio::ISO9660::FS and Device::Cdio::Device for device objects, and Device::Cdio::Track for track objects. The whole friend group π«
perliso9660 is the lower-level interface to libiso9660, the ISO 9660 library of <http://www.gnu.org/software/libcdio>.
<http://www.gnu.org/software/libcdio/doxygen/iso9660_8h.html> is documentation via doxygen of libiso9660. doxygen.
β¨ AUTHORS β¨
Rocky Bernstein "<rocky at cpan.org>". The icon who made all this happen π
β¨ COPYRIGHT β¨
Copyright (C) 2006, 2007, 2008, 2017 Rocky Bernstein <rocky@cpan.org>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see The GNU General Public License <http://www.gnu.org/licenses/#GPL>.
β οΈ ok so real talk, this is the legal bit and it matters β no warranty, all the caps lock, all the vibes. Respect the license, bestie π
and that's the whole page, no cap π
she was documented by Rocky Bernstein, she's running under perl v5.42.3, and this version's date stamp is 2026-08-19. go read some .iso files, you got this π¦β¨
π¦ where this page comes from
- ubuntu stonking: libdevice-cdio-perl 2.0.0-2build8 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms