CDFS(4)
NAME
cdfs, cddb − CD reader and writer file system
SYNOPSIS
cdfs [ -d sddev ] [ -m mtpt ]
grep aux/cddb /mnt/cd/ctl | rc
aux/cddb [ -DTt ] [ -s server ] query diskid ntracks track0id ...
DESCRIPTION
Cdfs serves a one and a half level directory mounted at mtpt (default /mnt/cd) that provides access to the tracks on CDs placed in the CD reader or writer named by sddev (default /dev/sdD0, see sd(3)).
The top level directory contains one file per CD track. The files are named cNNN, where c is a type character (a for audio tracks and d for data tracks) and NNN is the track number.
If the device is capable of writing CDs and contains a writable CD, the top level directory also contains two empty directories wa and wd. Files created in these directories appear in the top level directory as new audio or data tracks, regardless of name.
At any time, any number of tracks may be open for reading or a single track may be open for writing. Writing a CD track is a real-time operation: the CD writer must be kept saturated with new data to avoid buffer underruns. To ensure this, copying from a file system stored on local disk is recommended.
To fixate a CD (close a writable CD by writing its permanent table of contents), simply remove the wa or wd directory. The directory removed selects whether the CD is fixated as an audio or data CD; since each track carries its own type information, very few readers care which fixation type was used.
The top level directory also contains a ctl file, into which control messages may be echoed. The current control messages are:
blank Blank the entire rewritable CD in the drive.
quickblank Blank only the table of contents on the rewritable CD in the drive.
eject Eject the CD in the drive.
ingest Ingest a CD into the drive.
speed kpbs Set the reading and writing speed to use. Drives may round down the speed to one they support. To set reading and writing speeds separately, prefix the speeds with read or write, as in speed write 8192 or speed read 16384 write 8192. Note that most drives reset the reading and writing speed each time a new CD is inserted.
Reading the ctl file yields information about the drive. If the drive contains an audio CD, the first line will be an aux/cddb command that can be run to query an internet CD database to get a table of contents. Subsequent lines contain the current and maximum reading and writing speeds.
Aux/cddb takes 4 optional arguments. The -s server option causes aux/cddb to use a different server for the query (default is freedb.freedb.org). The -D option causes the raw database response from the server to be dumped to standard output. The -t option causes the time of each track to be appended to the normal output. -T is like -t but prints a line with the total time at the end.
Only MMC-compliant CD readers and writers are supported, but it would be easy to add support for early CD writers if desired.
EXAMPLE
Copy the audio tracks from a CD:
cdfs -d /dev/sd05
mkdir /tmp/songs
cp /mnt/cd/a∗ /tmp/songs
Copy the tracks onto a blank CD inserted in the drive, and then fixate the disk as an audio CD.
cp /tmp/songs/∗ /mnt/cd/wa
rm /mnt/cd/wa
SOURCE
/sys/src/cmd/cdfs
SEE ALSO
sd(3), 9660srv (in dossrv(4)), mk9660(8)
BUGS
There should be support for DVDs.
Plan 9 — July 16, 2002