Device...660::FS(3pm)
πΏ NAME πΏ
okay so bestie, welcome to Device::Cdio::ISO9660::FS β it's the class for reading ISO 9660 CDs, fr fr. Perl's own user-contributed docs, manual section 3pm, and it's genuinely iconic. π
β¨ SYNOPSIS β¨
So basically this whole thing wraps up the ISO 9660 Filesystem side of CD Tracks into one cute object. As such it's a... well, this library lowkey needs to be used together with Device::Cdio::ISO9660. They're a package deal, no cap.
use Device::Cdio::ISO9660:FS;
$cd = Device::Cdio::ISO9660::FS->new(-source=>'/dev/cdrom');
$statbuf = $cd->stat ($iso9660_path.$local_filename);
$blocks = POSIX::ceil($statbuf->{size} / $perlcdio::ISO_BLOCKSIZE);
for (my $i = 0; $i < $blocks; $i++) {
my $buf = $cd->read_data_blocks ($statbuf->{LSN} + $i);
die if !defined($buf);
}
print $buf;
πΈ DESCRIPTION πΈ
This is an Object-Oriented interface to the GNU CD Input and Control library (libcdio), which is written in C. This class handles ISO 9660 tracks on a CD or in a CD-ROM. she does one job and she does it gorgeously π
okay important vibe check though: working with a CD in a CD-ROM that has tracks in the ISO-9660 format is distinct from working with a file in a filesystem that contains an ISO-9660 image. Different eras, different energies. If you want the ISO 9660 image stored as a file in a filesystem, go see Device::Cdio::ISO9660::IFS, they've got you π¦
π CALLING ROUTINES π
Routines accept named parameters as well as positional parameters. For named parameters, each argument name gets a dash in front. Like this, bestie:
Device::Cdio::ISO9660::FS->new(-source=>'MYISO.CUE')
Each 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 acceptable, she does not care how you text her. In fact, only the first argument needs to begin with a dash. If a dash is present in the first argument, we assume dashes for the subsequent parameters. So efficient of her π
In the documentation below and elsewhere in this package, the parameter name that can be used in this style of call is given in the parameter list. For example, for close_tray the documentation below reads:
close_tray(drive=undef, driver_id=$perlcdio::DRIVER_UNKNOWN)
-> ($drc, $driver_id)
So the parameter names are drive, and driver_id. Neither parameter is required. If drive is not specified, a value of undef will be used. And if driver_id is not specified, a value of $perlcdio::DRIVER_UNKNOWN is used. defaults, she has them β¨
The older, more traditional style of positional parameters is also supported. So the new example from above can also be written:
Device::Cdio::ISO9660::FS->new('MYISO.CUE')
Finally, since no parameter name can be confused with a an integer, negative values will not get confused as a named parameter. (yes, the original says "a an integer", we're keeping the lore π)
π find_lsn π
find_lsn(lsn)->$stat_href
Find the filesystem entry that contains LSN and return information about it. undef is returned on error. simple, clean, main character energy π
π§ readdir π§
readdir(dirname)->@iso_stat
Read path (a directory) and return a list of iso9660 stat references.
Each item of @iso_stat is a hash reference which contains:
LSNβ the Logical sector number (an integer)sizeβ the total size of the file in bytessec_sizeβ the number of sectors allocatedfilenameβ the file name of the statbuf entryXAβ if the file has XA attributes;0if notis_dirβ1if a directory;0if a not; (again, keeping the lore, not fixing it, we don't do that here)
FIXME: If you look at iso9660.h you'll see more fields, such as for Rock-Ridge specific fields or XA specific fields. Eventually these will be added. Volunteers? π (not me though, bestie, I'm busy)
π 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. she's reading the super block, obviously she's super π
β read_superblock β
read_superblock(iso_mask=$libiso9660::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. yes it's giving twin, that's just how it is π«Ά
π stat π
stat(path, translate=0)->\%stat
Return file status for path name psz_path. NULL is returned on error.
If translate is 1, version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. lowercase? we love that actually β¨
Each item of @iso_stat is a hash reference which contains:
LSNβ the Logical sector number (an integer)sizeβ the total size of the file in bytessec_sizeβ the number of sectors allocatedfilenameβ the file name of the statbuf entryXAβ if the file has XA attributes;0if notis_dirβ1if a directory;0if a not;
π₯ SEE ALSO π₯
This is a subclass of Device::Cdio::Device. See also Device::Cdio::Device. See Device::Cdio::ISO9660::IFS for working with ISO 9660 images. the family tree is real π³
perliso9660 is the lower-level interface to libiso9660, the ISO 9660 library of libcdio. iykyk π
<http://www.gnu.org/software/libcdio/doxygen/iso9660_8h.html> is documentation via doxygen of libiso9660. doxygen.
π AUTHORS π
Rocky Bernstein. (yes that's the whole list, a legend, periodt π )
π 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>.
fr fr read the license, it's giving important, don't skip it bestie π
and that's the whole page, mwah π this doc came to you courtesy of perl v5.42.3, dated 2026-08-19 β go forth and read those ISO 9660 tracks, you absolute icon π¦β¨π
π¦ 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