CD_DREC Domain/OS CD_DREC
NAME
cd_drec, cd_cdrec - read Directory Record from CD-ROM
SYNTAX
#include <sys/cdrom.h>
int cd_drec(path, fsec, drec)
char *path;
int fsec;
struct iso9660_drec *drec;
int cd_cdrec(path, fsec, drec)
char *path;
int fsec;
char *drec;
DESCRIPTION
The function cd_drec() fills the drec structure with the contents of the
Directory Record associated with a file or directory which 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
Directory Record 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 declaration for struct iso9660_drec is contained in
<sys/cdrom.h>.
The cd_cdrec() function copies the Directory Record as recorded on the
CD-ROM to the address drec. The user must allocate CD_MAXDRECL bytes for
the Directory Record. CD_MAXDRECL is contained in <sys/cdrom.h>.
RETURN VALUE
Upon successful completion, the functions return a value of zero. In case
of an error, -1 is returned and errno is set to indicate the error.
ERRORS
The functions will fail if one or more of the following is true:
[EACCESS]
Search permission is denied for a component of the path
prefix. Read permission is denied for the file or directory pointed
to by path.
[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.
[EINVAL]
The value of fsec is invalid.
The argument path points to a file/directory that is
not within the CD-ROM file hierarchy.
[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 drec 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.