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 bytes
  • sec_size β€” the number of sectors allocated
  • filename β€” the file name of the statbuf entry
  • XA β€” if the file has XA attributes; 0 if not
  • is_dir β€” 1 if a directory; 0 if 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 bytes
  • sec_size β€” the number of sectors allocated
  • filename β€” the file name of the statbuf entry
  • XA β€” if the file has XA attributes; 0 if not
  • is_dir β€” 1 if a directory; 0 if 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 (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