perlcdio(3pm)

✨ NAME ✨

okay so welcome to perlcdio(3pm) πŸ’– β€” this is the page for perlcdio, the lower-level wrapper to libcdio, aka the CD Input and Control library. yes bestie, we're talking about CDs, in this economy. iconic. πŸ’Ώβœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

ngl this is a pretty straight-forward wrapper around the C library libcdio. like, it does the thing, no drama.

And yes, it is perfectly usable on its own, but fr fr β€” the expected move is that the Object-Oriented interface Device::Cdio is what most people will actually want to use. that's the main character. this one is the vibes backstage. πŸ‘‘

There are various constants that are defined here. many constants. a concerning amount, honestly. we'll get to them. 🫢


🌸 DESCRIPTION 🌸

The encapsulation is done in two parts, lowkey a duo:

  • The lower-level Perl interface is called perlcdio (this file, hi, that's me πŸ’…)
  • and it is generated via SWIG.

periodt. that's the whole architecture. ✨


πŸ’œ CONSTANTS πŸ’œ

🌈 Driver ID's 🌈

  • DRIVER_UNKNOWN β€” use this when you don't know what kind of driver it is and you don't care whether it's a CD image driver or a real CD-ROM driver. see also DRIVER_DEVICE, which does not include image drivers. so like, this one is the "idk and idc" option 😌
  • DRIVER_AIX β€” driver for IBM's AIX.
  • DRIVER_BSDI β€” driver for BSDI.
  • DRIVER_FREEBSD β€” driver for Free BSD.
  • DRIVER_LINUX β€” driver for GNU/LINUX.
  • DRIVER_SOLARIS β€” driver for Solaris.
  • DRIVER_OSX β€” driver for Apple's OS X.
  • DRIVER_WIN32 β€” driver for Microsoft Windows.
  • DRIVER_CDRDAO β€” image driver for cdrdao.
  • DRIVER_BINCUE β€” image driver for CDRWin BIN/CUE.
  • DRIVER_NRG β€” image driver for Nero NRG.
  • DRIVER_DEVICE β€” use when you don't know what kind of driver it is, but the driver has to be a real CD-ROM driver. see also DRIVER_UNKNOWN, which does include image drivers. so this one is the "idk but make it physical" option πŸŽ€

🌟 Driver Return codes 🌟

so, driver operations return a status code. here's the whole roster, no skips:

  • DRIVER_OP_SUCCESS β€” the driver operation was successful. slay. πŸŽ‰
  • DRIVER_OP_ERROR β€” the driver operation had an error of some sort. πŸ’€
  • DRIVER_OP_UNSUPPORTED β€” this operation is not supported for this driver. for example, ejecting a CD from an image driver. yeah, you can't eject a file bestie, it's not a real tray 😭
  • DRIVER_OP_UNINIT β€” the source is not initialized for this operation.
  • DRIVER_OP_NOT_PERMITTED β€” the operation is not permitted.
  • DRIVER_OP_BAD_PARAMETER β€” an invalid parameter got passed to the routine.
  • DRIVER_OP_BAD_POINTER β€” a pointer somehow got corrupted. πŸ™ˆ we don't talk about it.
  • DRIVER_OP_NO_DRIVER β€” no driver has been set.

🧚 Device Capabilities 🧚

Miscellaneous

these ones literally just sit here with no little description, so here they are, name for name, no commentary invented, no cap:

  • DRIVE_CAP_ERROR
  • DRIVE_CAP_UNKNOWN
  • DRIVE_CAP_MISC_CLOSE_TRAY
  • DRIVE_CAP_MISC_EJECT
  • DRIVE_CAP_MISC_LOCK
  • DRIVE_CAP_MISC_SELECT_SPEED
  • DRIVE_CAP_MISC_SELECT_DISC
  • DRIVE_CAP_MISC_MULTI_SESSION
  • DRIVE_CAP_MISC_MEDIA_CHANGED
  • DRIVE_CAP_MISC_RESET
  • DRIVE_CAP_MISC_FILE

Read Capabilities

same situation β€” no one-liners given, so no spoilers from me:

  • DRIVE_CAP_READ_AUDIO
  • DRIVE_CAP_READ_CD_DA
  • DRIVE_CAP_READ_CD_G
  • DRIVE_CAP_READ_CD_R
  • DRIVE_CAP_READ_CD_RW
  • DRIVE_CAP_READ_DVD_R
  • DRIVE_CAP_READ_DVD_PR
  • DRIVE_CAP_READ_DVD_RAM
  • DRIVE_CAP_READ_DVD_ROM
  • DRIVE_CAP_READ_DVD_RW
  • DRIVE_CAP_READ_DVD_RPW
  • DRIVE_CAP_READ_C2_ERRS
  • DRIVE_CAP_READ_MODE2_FORM1
  • DRIVE_CAP_READ_MODE2_FORM2
  • DRIVE_CAP_READ_MCN
  • DRIVE_CAP_READ_ISRC

πŸ”₯ Writing masks πŸ”₯

  • DRIVE_CAP_WRITE_CD_R
  • DRIVE_CAP_WRITE_CD_RW
  • DRIVE_CAP_WRITE_DVD_R
  • DRIVE_CAP_WRITE_DVD_PR
  • DRIVE_CAP_WRITE_DVD_RAM
  • DRIVE_CAP_WRITE_DVD_RW
  • DRIVE_CAP_WRITE_DVD_RPW
  • DRIVE_CAP_WRITE_MT_RAINIER
  • DRIVE_CAP_WRITE_BURN_PROOF

Derived Capabilities

these ones do get a vibe check, and they all passed:

  • DRIVE_CAP_WRITE_CD β€” has some sort of CD writer ability. πŸ’Ώ
  • DRIVE_CAP_WRITE_DVD β€” has some sort of DVD writer ability.
  • DRIVE_CAP_WRITE β€” has some sort of writer ability. like, some. any. writing happens. ✍️

πŸ“ Filesystem type constants πŸ“

so these constants get used when you're getting drive capabilities:

  • FS_AUDIO β€” audio only. not really a filesystem, it's just out here living its truth 🎧
  • FS_HIGH_SIERRA β€” High-Sierra Filesystem.
  • FS_ISO_9660 β€” ISO-9660 filesystem.
  • FS_INTERACTIVE
  • FS_HFS β€” the file system used on the Macintosh system in MacOS 6 through MacOS 9, and deprecated in OSX. rip old mac filesystem, you were so real 🫑
  • FS_UFS β€” generic Unix file system derived from the Berkeley fast file system.
  • FS_EXT2 β€” EXT2 was the GNU/Linux native filesystem for early kernels. newer GNU/Linux OS's may use EXT3, which is EXT2 with a journal.
  • FS_ISO_HFS β€” both HFS & ISO-9660 filesystem. two filesystems, one CD ✨
  • FS_ISO_9660_INTERACTIVE β€” both CD-RTOS and ISO filesystem.
  • FS_3DO β€” the 3DO is, technically, a set of specifications created by the 3DO company. these specs are for making a 3DO Interactive Multiplayer, which uses a CD-player. Panasonic in the early 90's was the first company to manufacture and market a 3DO player. history lesson, bestie, take notes πŸ“
  • FS_XISO β€” Microsoft X-BOX CD.
  • FS_UDFX
  • FS_UDF
  • FS_ISO_UDF
  • FS_ANAL_XA β€” eXtended Architecture format.
  • FS_ANAL_MULTISESSION β€” the CD has multisesion.
  • FS_ANAL_PHOTO_CD β€” is a Kodak Photo CD. πŸ“Έ
  • FS_ANAL_HIDDEN_TRACK β€” hidden track at the beginning the CD. sneaky little thing πŸ˜Άβ€πŸŒ«οΈ
  • FS_ANAL_CDTV
  • FS_ANAL_BOOTABLE β€” the CD is bootable. πŸ‘‘
  • FS_ANAL_VIDEOCD β€” VCD 1.1.
  • FS_ANAL_ROCKRIDGE β€” has Rock Ridge Extensions to ISO 9660.
  • FS_ANAL_JOLIET β€” Microsoft Joliet extensions to ISO 9660.
  • FS_ANAL_SVCD β€” Super VCD or Choiji Video CD.
  • FS_ANAL_CVD β€” Choiji Video CD.
  • FS_ANAL_XISO β€” XBOX CD determined by some analysis.
  • FS_MATCH_ALL β€” a bitmask which can be used to specify matching any sort of CD. the "i'll take one of everything" of bitmasks πŸ›’

⭐ Sector size constants ⭐

  • CD_FRAMESIZE
  • CD_FRAMESIZE_RAW β€” size of a Philip Red book CD-DA block. it is also the maximum CD sector size possible: 2352 bytes.
  • ISO_BLOCKSIZE β€” size of an ISO 9660 block. also the size of the data portion in CD data reads: 2048 bytes.
  • M2F2_SECTOR_SIZE β€” Mode 2 Form 2 Data size: 2328 bytes.
  • M2RAW_SECTOR_SIZE β€” Mod1 Form 1 Data size: 2336 bytes.

🌈 Reading Modes 🌈

  • READ_MODE_AUDIO β€” audio mode (CD-DA) read. Blocksize is a multiple of $perlcdio::CD_FRAMESIZE_RAW (2352) bytes.
  • READ_MODE_M1F1 β€” Mode 1 Form 1 read. Blocksize is a multiple of $perlcdio::CD_FRAMESIZE (2048) bytes.
  • READ_MODE_M1F2 β€” Mode 1 Form 2 read. Blocksize is a multiple of $perlcdio::M2RAW_SECTIOR_SIZE (2336) bytes. (yes it says SECTIOR_SIZE in there, that is genuinely the spelling, I am not touching it, hand on heart 🀝)
  • READ_MODE_M2F1 β€” Mode 2 Form 1 read. Blocksize is a multiple of $perlcdio::CD_FRAMESIZE (2048) bytes.
  • READ_MODE_M2F2 β€” Mode 2 Form 1 read. Blocksize is a multiple of (2328) bytes.

πŸ’« Miscellaneous πŸ’«

  • VERSION_NUM β€” the libcdio version that is getting used.
  • INVALID_LBA β€” canonical value used for an invalid LBA.
  • INVALID_LSN β€” canonical value used for an invalid LSN.
  • INVALID_TRACK β€” canonical value used for an invalid track number. (valid range is 0 to 99.)
  • LEADOUT_TRACK β€” canonical value for the "leadout", or the track just after the last track. so again, this value is outside the range 0 to 99. the leadout track is often used to get the last LSN or LBA. the libcdio routines also allow the last actual track plus one as a synonym for the leadout track.

πŸ’… METHODS πŸ’…

cdio_version

perlcdio::cdio_version

Returns the libcdio version string that Device::Cdio is currently linked with. cute lil version check πŸŽ€

this

This seems to be an artifact of SWIG. that's it. that's the whole entry. SWIG left it here, we respect it πŸ™ˆ


πŸ‘€ SEE ALSO πŸ‘€

<http://www.gnu.org/software/libcdio> β€” it has documentation on libcdio, including a manual and the API via doxygen. go read it, iykyk πŸ“šβœ¨


🫢 AUTHORS 🫢

Rocky Bernstein <rocky at cpan.org>.


Copyright (C) 2006, 2008, 2011 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 <http://www.gnu.org/licenses/>.

okay that's the legal part, which means it's the serious part β€” no jokes needed, just respect the license bestie, fr fr πŸ’–

aaaand that's the whole page!! ty for coming to my ted talk, go read Device::Cdio if you actually want the Object-Oriented experience, mwah πŸ’‹

this was perl v5.42.3, dated 2026-08-19, and it lives at perlcdio(3pm) β€” stay iconic, bye πŸ¦‹βœ¨πŸ‘‘

πŸ“¦ where this page comes from