Tao.PhysFs SDK Documentation

Fs.PHYSFS_getCdRomDirs Method 

Get an array of paths to available CD-ROM drives.

[Visual Basic]
Public Shared Function PHYSFS_getCdRomDirs() As String()
[C#]
public static string[] PHYSFS_getCdRomDirs();

Return Value

Null-terminated array of null-terminated strings.

Remarks

The dirs returned are platform-dependent ("D:\" on Win32, "/cdrom" or whatnot on Unix). Dirs are only returned if there is a disc ready and accessible in the drive. So if you've got two drives (D: and E:), and only E: has a disc in it, then that's all you get. If the user inserts a disc in D: and you call this function again, you get both drives. If, on a Unix box, the user unmounts a disc and remounts it elsewhere, the next call to this function will reflect that change. Fun.

The returned value is an array of strings, with a NULL entry to signify the end of the list:

            char **cds = PHYSFS_getCdRomDirs();
            char **i;
            for (i = cds; *i != NULL; i++)
                    printf("cdrom dir [%s] is available.\n", *i);
                PHYSFS_freeList(cds);

This call may block while drives spin up. Be forewarned.

When you are done with the returned information, you may dispose of the resources by calling PHYSFS_freeList with the returned pointer.

Note that Tao.PhysFs calls PHYSFS_freeList for you.

See Also

Fs Class | Tao.PhysFs Namespace