CD-ROM Mount Points

I was wondering if there was a way to get a CD-ROM’s mount point from an
SDL_CD structure. (Even if it’s another SDL sub-library.) I couldn’t
find one in the documentation or by googling a little for it.

If not, I’d make a patch for it, but I’m not too sure how to do it under
Linux/UNIX or Mac (though I could research it). It just might be a lot
faster for someone who knows how to do it off hand.

I know SDL_CD is oriented around CD-ROM audio, but checking for files
would be very useful to choose the CD-ROM device that has the CD-ROM for
a game you are looking for.

General Description:

const char *SDL_CDMountPoint(SDL_CD *cdrom);

Description:
SDL_CDMountPoint returns a NULL terminated string containing the mount
point of the data portion of the CDROM (Audio and Data are on different
places on Mac OS X). Mount points would be something like “E:”,
"/mnt/cdrom", “/Volumes/Your CD”.

Return Value:
SDL_CDMountPoint a string containing the mount point of the CDROM. A
NULL pointer means the drive is not mounted.

Does this sound reasonable? I haven’t looked yet, but does SDL_CDOpen()
attempt to mount the CD-ROM on UNIX systems?–
Joe Tennies

I was wondering if there was a way to get a CD-ROM’s mount point from an
SDL_CD structure. (Even if it’s another SDL sub-library.) I couldn’t
find one in the documentation or by googling a little for it.

Isn’t that what the SDL_CDName() function does?

----- Original Message -----
From: rotund@fatnsoft.com (Joe Tennies)
To: “SDL List”
Sent: Wednesday, February 19, 2003 11:03 AM
Subject: [SDL] CD-ROM Mount Points

Philip D. Bober said:

Isn’t that what the SDL_CDName() function does?

No, SDL_CDName() is supposed to be a human readable name, which is not a
mount point, though all are currently related to the device name (as far
as I’ve seen).

A big example of where this isn’t true is under Linux. It’ll return
"/dev/cdrom". I cannot look at ‘/dev/cdrom/myfile’. It works under
Windows fairly well, though. I’d want it to return something like
"/mnt/cdrom/".

Philip D. Bober said:

Isn’t that what the SDL_CDName() function does?

No, SDL_CDName() is supposed to be a human readable name, which is not > a mount point, though all are currently related to the device name (as > far as I’ve seen).

A big example of where this isn’t true is under Linux. It’ll return
"/dev/cdrom". I cannot look at ‘/dev/cdrom/myfile’. It works under
Windows fairly well, though. I’d want it to return something like
"/mnt/cdrom/".

If there exist no SDL function for this I suggest you write a /etc/fstab parser to get the systems mount point for the cdrom. Place the whole code in some #ifdef LINUX #endif and it should never interfere with your Windows code (which is working, as you said).

Bye,
Daniel SchneidereitOn 19 Feb 2003 18:35:04 -0800 Joe Tennies wrote:

Joe Tennies writes:

Philip D. Bober said:

Isn’t that what the SDL_CDName() function does?

No, SDL_CDName() is supposed to be a human readable name, which is not a
mount point, though all are currently related to the device name (as far
as I’ve seen).

A big example of where this isn’t true is under Linux. It’ll return
"/dev/cdrom". I cannot look at ‘/dev/cdrom/myfile’. It works under
Windows fairly well, though. I’d want it to return something like
"/mnt/cdrom/".
Take a look at PhysicsFS (http://icculus.org/physfs).
It will give you available CDROM paths and much more.

– Ed