Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

CD_XAR                            Domain/OS                             CD_XAR



NAME
     cd_xar, cd_cxar - read Extended Attribute Record from CD-ROM

SYNTAX
     #include <sys/cdrom.h>

     int cd_xar(path, fsec, xar, lenappesc)
     char *path;
     int fsec;
     struct iso9660_xar *xar;
     int lenappesc;

     int cd_cxar(path, fsec, xar, xarlen)
     char *path;
     int fsec;
     char *xar;
     int xarlen;

DESCRIPTION
     The function cd_xar() fills the xar structure with the contents of the
     XAR associated with a file or directory that is referred to by the
     argument path. The argument fsec specifies the File Section of that file.
     The numbering starts with one. If fsec is set to -1, the XAR of the last
     File Section of that file is assumed. The argument path points to a file
     or a directory within the CD-ROM file hierarchy. The argument lenappesc
     determines how many bytes of the variable part of the XAR (Application
     Use field and Escape Sequences field) are copied. The user must allocate
     enough memory beyond the xar structure for these fields. The total number
     of logical blocks of an XAR can be obtained by the cd_pvd() function. The
     length of the fixed part of the XAR is given by CD_XARFIXL. The
     declaration for struct iso9660_xar and the definition of CD_XARFIXL are
     contained in <sys/cdrom.h>.

     The cd_cxar() function copies the XAR as recorded on the CD-ROM to the
     address xar. With xarlen set appropriately, part of the XAR or the full
     XAR will be read.


RETURN VALUE
     The cd_xar() function returns the number of bytes copied for the variable
     part of the XAR. The cd_cxar() function returns the number of bytes
     copied. In case of an error, -1 is returned and errno is set to indicate
     the error.

ERRORS
     The functions will fail if or more of the following is true:

     [EACCESS]
             Search permission is denied for a component of the path
             prefix. Read permission for the file or directory pointed
             to by path is denied.

     [ENAMETOOLONG]
             The length of the path string exceeds {PATH_MAX} or a
             pathname component is longer than {NAME_MAX} while
             {_POSIX_NO_TRUNC} is in effect.

     [ENOENT]
             A component of path does not exist or the path
             argument points to an empty string.
             The File Section indicated by fsec has no XAR.

     [EINVAL]
             The value of fsec or xarlen is invalid.
             The argument path points to a file/directory not within
             the CD-ROM file hierarchy.

     [ENODEV]
             The Volume containing the File Section indicated by fsec
             is not mounted.

     [ENOTDIR]
             A component of the path prefix is not a directory.

     [ENXIO]
             The CD-ROM is not in the drive or a read error ocurred.

     [EFAULT]
             The address of xar or path is invalid.

     [EINTR]
             A signal was caught during one of the functions.

     [EMFILE]
             {OPEN_MAX} file descriptors are currently open in the
             calling process.

     [ENFILE]
             The system file table is full.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026