perliso9660(3pm)

NAME
perliso9660 - lower-level wrapper to libiso9660, the ISO 9660 library of the CD Input and Control package

SYNOPSIS
This is fairly straight-forward wrapper around the C library libiso9660 Although this is perfectly usable on its own, it is expected that the Object-Oriented interface Device::Cdio::ISO9660 is what most people will want to use.

There are various constants that are defined here.

DESCRIPTION
Encapsulation is done in two parts. The lower-level Perl interface is called perliso9660 (this file) and is generated via SWIG.

CONSTANTS

ISO_BLOCKSIZE
    Number of bytes in an ISO 9660 block (2048)

PVD_SECTOR
    "Primary Volume Descriptor" sector (16)

EVD_SECTOR
    "End Volume Descriptor" sector (17)

LEN_ISONAME
    Size in bytes of the filename portion + null byte (31)

MAX_SYSTEM_ID
    Maximum number of characters in a system id (32)

MAX_ISONAME
    Size in bytes of the filename portion + null byte. (37)

MAX_PREPARER_ID
    Maximum number of characters in a preparer id. (128)

MAX_ISOPATHNAME
    Maximum number of characters in the entire ISO 9660 filename. (255)

MAX_PUBLISHER_ID
    Maximum number of characters in a publisher id.

MAX_APPLICATION_ID
    Maximum number of characters in an application id.

MAX_VOLUME_ID
    Maximum number of characters in a volume id.

MAX_VOLUMESET_ID
    Maximum number of characters in a volume-set id.

STANDARD_ID
    String inside frame which identifies an ISO 9660 filesystem. This string is the "id" field of an iso9660_pvd_t or an iso9660_svd_t.

EXTENSION_JOLIET_LEVEL1
    Use Joliet Level 1.

EXTENSION_JOLIET_LEVEL2
    Use Joliet Level 2.

EXTENSION_JOLIET_LEVEL3
    Use Joliet Level 3

EXTENSION_ROCK_RIDGE
    Use Rock-Ridge Extensions.

EXTENSION_HIGH_SIERRA
    Use High-Sierra Extensions.

EXTENSION_ALL
    Use any of the above extensions.

EXTENSION_NONE
    Use none of the above extensions.

EXTENSION_JOLIET
    Use any Joliet Extension available.

  Directory Flags

FILE
    Not really a flag but the lack of one.

EXISTENCE
    Do not make existence known (hidden).

DIRECTORY
    This file is a directory.

ASSOCIATED
    This file is an associated file

RECORD
    Record format is in extended attribute if not set.

PROTECTION
    No read/execute permission in extended attribute.

DRESERVED1
    Reserved bit 5.

DRESERVED2
    Reserved bit 6

MULTIEXTENT
    Not the final entry of a multi-extent file.

  Volume Descriptor Types

VD_BOOT_RECORD
    CD is bootable

VD_PRIMARY
    Primary Volume descriptor which must be in any ISO-9660

VD_SUPPLEMENTARY
    (optional) Supplimentary Volume Descriptor. But used by Joliet, for example.

VD_PARITION
    Indicates a partition of a CD.

VD_END

  Flags for strncpy
NOCHECK
    Enumeration meaning don not check in strncpy_pad.

SEVEN_BIT
    Enumeration in strncpy_pad for checking entry has only 7-bit characters.

ACHARS
    Enumeration in strncpy_pad for checking entry has only ACHARs.

DCHARS
    Enumeration in strncpy_pad for checking entry has only DCHARs.

SUBROUTINES

  Input Output
open_iso

Open an ISO 9660 image for reading. Maybe in the future we will have mode. undef is returned on error.

open_ext

Open an ISO 9660 image for reading allowing various ISO 9660 extensions. Maybe in the future we will have a mode. undef is eturned on error.

open_fuzzy

Open an ISO 9660 image for reading with some tolerence for positioning of the ISO9660 image. We scan for $perliso9660::ISO_STANDARD_ID and use that to set he eventual offset to adjust by (as long as that is <= i_fuzz).

Maybe in the future we will have a mode. undef is returned on error.

See also open_iso

open_fuzzy_ext

Open an ISO 9660 image for reading with some tolerence for positioning of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz).

Maybe in the future we will have a mode. undef is returned on error.

ifs_fuzzy_read_superblock

Read the Super block of an ISO 9660 image but determine framesize and datastart and a possible additional offset. Generally here we are not reading an ISO 9660 image but a CD-Image which contains an ISO 9660 filesystem.

close

Close previously opened ISO 9660 image. 1 is unconditionally returned. If there was an error 0 would be returned.

seek_read

Seek to a position and then read n bytes. (buffer, size) are is returned.

fs_read_pvd

Read the Primary Volume Descriptor for a CD. 1 is returned if read, and 0 if there was an error.

ifs_read_pvd

Read the Primary Volume Descriptor for an ISO 9660 image. 1 is returned if read, and 0 if there was an error.

_fs_read_superblock

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.

ifs_read_superblock

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.

  Time Conversion
set_dtime

Set time in format used in ISO 9660 directory index record from a Unix time structure.

set_ltime

Set "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure.

get_dtime

Get Unix time structure from format use in an ISO 9660 directory index record. Even though tm_wday and tm_yday fields are not explicitly in dtime, they are calculated from the other fields.

If tm is to reflect the localtime, set "use_localtime" 1, otherwise tm will reported in GMT.

get_ltime

Get "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure.

  Character Classification and String Manipulation
is_dchar

Return 1 if c (an int) is a DCHAR - a character that can appear in an an ISO-9600 level 1 directory name. These are the ASCII capital letters A-Z, the digits 0-9 and an underscore.

is_achar

name_translate

Convert an ISO-9660 file name that stored in a directory entry into what is usually listed as the file name in a listing. wercase name, and remove trailing ;1's or .;1's and turn the others into version numbers.

name_translate_ext

Convert an ISO-9660 file name that stored in a directory entry into what is usually listed as the file name in a listing. Lowercase name if no Joliet Extension interpretation. Remove trailing ;1's or .;1's and turn the others into version numbers.

strncpy_pad

Pad string src with spaces to size len and copy this to dst. If len is less than the length of src, dst will be truncated to the first len characters of src.

src can also be scanned to see if it contains only ACHARs, DCHARs, 7-bit ASCII chars depending on the enumeration _check.

In addition to getting changed, dst is the return value. Note: this string might not be undef terminated.

  File and Directory Names
dirname_valid_p

Check that psz_path is a valid ISO-9660 directory name.

A valid directory name should not start out with a slash (/), dot (.) or null byte, should be less than 37 characters long, have no more than 8 characters in a directory component which is separated by a /, and consist of only DCHARs.

1 is returned if psz_path is valid.

pathname_isofy

Take psz_path and a version number and turn that into a ISO-9660 pathname. (That is just the pathname followed by ";" and the version number. For example, mydir/file.ext -> MYDIR/FILE.EXT;1 for version 1. The resulting ISO-9660 pathname is returned.

pathname_valid_p

Check that psz_path is a valid ISO-9660 pathname.

A valid pathname contains a valid directory name, if one appears and the filename portion should be no more than 8 characters for the file prefix and 3 characters in the extension (or portion after a dot). There should be exactly one dot somewhere in the filename portion and the filename should be composed of only DCHARs.

1 is returned if psz_path is valid.

fs_find_lsn

Given a directory pointer, find the filesystem entry that contains lsn and return information about it.

Returns stat_t of entry if we found lsn, or undef otherwise.

ifs_find_lsn

Given a directory pointer, find the filesystem entry that contains lsn and return information about it.

Returns stat_t of entry if we found lsn, or undef otherwise.

fs_stat

Return file status for psz_path. undef is returned on error.

fs_stat_translate

Return file status for path name psz_path. undef is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased.

ifs_stat

Return file status for pathname. undef is returned on error.

ifs_stat_translate

Return file status for path name psz_path. undef is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased.

fs_readdir

Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory. The caller must free the returned result.

ifs_readdir

Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory. The caller must free the returned result.

get_dir_len

Return the directory name stored in the iso9660_dir_t

A string is allocated: the caller must deallocate.

dir_to_name

get_posix_filemode

Returns a POSIX mode for a given p_iso_dirent.

  Primary Volume Descriptor Routines
get_application_id

Return the PVD's application ID.

undef is returned if there is some problem in getting this.

ifs_get_application_id

Get the application ID. psz_app_id is set to undef if there is some problem in getting this and 0 is returned.

get_preparer_id

Return a string containing the preparer id with trailing blanks removed.

ifs_get_preparer_id

Get the preparer ID. psz_preparer_id is set to undef if there is some problem in getting this and 0 is returned.

get_publisher_id

Return a string containing the PVD's publisher id with trailing blanks removed.

ifs_get_publisher_id

Get the publisher ID. psz_publisher_id is set to undef if there is some problem in getting this and 0 is returned.

get_pvd_type

get_pvd_id

get_pvd_space_size

get_pvd_block_size

get_pvd_version

Return the primary volume id version number (of pvd). If there is an error 0 is returned.

get_system_id

Return a string containing the PVD's system id with trailing blanks removed.

ifs_get_system_id

Get the system ID. psz_system_id is set to undef if there is some problem in getting this and 0 is returned.

get_root_lsn

Return the LSN of the root directory for pvd. If there is an error CDIO_INVALID_LSN is returned.

get_volume_id

Return the PVD's volume ID.

ifs_get_volume_id

Get the system ID. psz_system_id is set to undef if there s some problem in getting this and 0 is returned.

get_volumeset_id

Return the PVD's volumeset ID. undef is returned if there is some problem in getting this.

ifs_get_volumeset_id

Get the systemset ID. psz_systemset_id is set to undef if there is some problem in getting this and 0 is returned.

  Path Table Routines
iso9660_pathtable_init

Zero out pathable. Do this first.

pathtable_get_size

pathtable_l_add_entry

pathtable_m_add_entry

set_evd

  Miscellaneous
get_joliet_level

Return the Joliet level recognized for p_iso.

ifs_is_xa

Return 1 if ISO 9660 image has extended attrributes (XA).

METHODS

  this
This seems to be an artifact of SWIG.

SEE ALSO
<http://www.gnu.org/software/libcdio> has documentation on libcdio including the a manual and the API via doxygen.

AUTHORS
Rocky Bernstein "<rocky at cpan.org>".

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