DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

cd_drec(3X)


cd_drec, cd_cdrec -- read Directory Record from CD-ROM directory

Synopsis

   cc [flag . . . ] file . . . -lcdfs -lgen [library] . . .
   

#include <sys/cdrom.h>

int cd_drec(const char *path, int fsec, struct iso9660_drec *drec);

int cd_cdrec(const char *path, int fsec, char *drec);

Description

cd_drec fills the drec structure with the contents of the Directory Record associated with a file or directory referred to by path.

cd_cdrec copies the complete Directory Record on the CD-ROM to the address drec.

CD_MAXDRECL defines the size of the Directory Record.


path
File or directory in the CD-ROM file system.

fsec
Specifies the File Section of the named file. The numbering starts with one. The number -1 denotes the last File Section of the named file, or the only File Section of the named directory.

drec
Pointer to structure or character array where Directory Record is to be copied. The character array must contain at least CD_MAXDRECL bytes.

Return values

On success, cd_drec returns a value of zero. On failure, cd_drec returns a value of -1 and sets errno to identify the error as follows:


EACCES
Read permission is denied on the directory or file that path points to, or search permission is denied for a component of path

EFAULT
Invalid address for drec or path.

EINTR
Signal caught during the execution of one of the functions.

EINVAL
The value of fsec is invalid, or path points to directory or file outside of the CD-ROM file hierarchy.

EMFILE
The maximum number of file descriptors are open.

ENAMETOOLONG
The size of path exceeds MAXPATHLEN, or the component of a path name is longer than MAXNAMELEN while _POSIX_NO_TRUNC is in effect.

ENFILE
The system file table is full.

ENOENT
path does not exist or the path argument points to an empty string.

ENOTDIR
A component of path is not a directory.

ENXIO
A read error or the CD-ROM is not in the drive.

References

cddrec(1M)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004