cd_nmconv(3X)
cd_nmconv --
set or get CD-ROM name conversion flag
Synopsis
cc [flag . . . ] file . . . -lcdfs -lgen [library] . . .
#include <sys/cdrom.h>
int cd_nmconv(const char *path, int cmd, int *flag);
Description
cd_nmconv sets or gets the name conversion flag for
file names on the mounted CD-ROM.
cd_nmconv provides a way to make the CD-ROM
file names appear consistent with the names on the rest
of the system.
CD-ROM file identifiers take the following
format:
FILENAME.FILENAME_EXTENSION;VERSION
where FILENAME and FILENAME_EXTENSION
are alphanumeric and VERSION is a number.
If the name conversion flag needs to be set,
set it after the CD-ROM has been mounted,
but before any CD-ROM access occurs.
If the command is executed while files are open,
the changes will not take effect until the file is closed.
- path
-
Mount point of a CD-ROM file system.
- cmd
-
CD_SETNMCONV to set the conversion
flag or CD_GETNMCONV to get the value
of the conversion flag.
- flag
-
flag is a pointer to one of the following:
- CD_NOCONV
-
No conversion
- CD_LOWER
-
Convert characters in file identifiers to lower case.
If a file identifier doesn't contain
a filename extension, don't display the period (``.'').
You may use CD_LOWER and CD_NOVERSION
separately or together.
- CD_NOVERSION
-
The version number and the semicolon (``;'') of a File
Identifier are not represented.
You may use CD_LOWER and CD_NOVERSION
separately or together.
Return values
On success, cd_nmconv returns a value of zero.
On failure, cd_nmconv returns -1
and sets errno to identify the error as follows:
- EACCES
-
Read permission is denied on the mount point, or
search permission is denied on a component of path.
- EFAULT
-
Invalid address for flag or path.
- EINTR
-
A signal was caught during the execution of the
cd_nmconv function.
- EINVAL
-
The value of cmd or flag is invalid, or path
argument does not point to a mount point of a CD-ROM file system.
- 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.
- EPERM
-
User lacks write permission to set values.
References
cdmntsuppl(1M),
cdfs-specific
mount_cdfs(1M)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.