one-eye has asked for the wisdom of the Perl Monks concerning the following question:

Looking for a way to read the file table directly from a data CD so that this can then be passed to a database. I can handle the passing of the information around once it's been read from the CD, but I need to know how to do the reading in Perl. Ay ideas? Thanks one-eye

Replies are listed 'Best First'.
Re: Reading the file table off a CD
by rpc (Monk) on Mar 16, 2001 at 23:37 UTC
    I'm interpreting this question as a general block device reading problem.

    You should be able to open the cdrom device like any other file. If you want the true file table, you will have to read raw data ala sysread and implement the appropriate ISO 9660 code yourself. This is well beyond the scope of the Monestary. It is also reinventing the wheel, as I'm sure there are excellent, flexible programs already available to do this for you.

Re: Reading the file table off a CD
by webdaemon (Acolyte) on Mar 16, 2001 at 22:49 UTC
    perl -e'@a=`find /mnt/cdrom`=~ /\n(.*)\n/g;print @a;'

    This one line will fill and dispay the @a array with all the files on of the cdrom

    Some perl gurus will say that using find and quotes is for lazy people .. but isn't it perl philosophy ?