Forum Moderators: coopster

Message Too Old, No Replies

"AutoDetecting" CD/DVD drive path

Is there some kind of "%CD_PATH%" internal reference?

         

StupidScript

5:14 pm on Sep 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is the CD/DVD drive "D:" or "Z:" or "/mnt/cdrom1" or what?

It's easy enough to prompt the user to browse for that info. I'd like to find out if there is already some kind of built-in PHP directory walker that can discover this?

I could run through

is_dir('D:/mydir',...'Z:/mydir')
and
is_dir('/mnt/cdrom/mydir',...'/mnt/cdrom4/mydir')
or something. It seems inefficient. mnoGoSearch might be a little faster, unless a fresh index needs to be made with each initialization, if I understand the docs for this type of situation correctly. But it's basically the same approach.

Thank you in advance.

leatherback

11:56 am on Sep 4, 2005 (gmt 0)

10+ Year Member



Hi StupidScript,

Note sure about the answer to your question.
BUT I hope you realize that you will not have access to the users' filesystem. You can only use these scripts on the server. The security risk involved with giving you access to the clients' filesystem is too great, and therefore impossible.

J.

StupidScript

6:34 pm on Sep 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, leatherback. I do understand that, although I'm bucking the "impossible" label ... isn't there some kind of security certificate the visitor can approve to allow it?

What I need to do is

1) Produce a CD/DVD of subscripted content
2) Register users at the website
3) Send them their copy of the content
4) They log in with the disk in their drive, and the subscripted content on the disk is integrated with the online content by virtue of the path to the materials, i.e.

<?

$cdpath=getCDPath();

?>

where

getCDPath()
is a function that figures out which drive association contains the subscripted content. Then a cookie is written and subsequent pages use that path info, i.e.

<img src="<?=$cdpath?>/images/image1.gif">

Like I said, it's quite easy to get the visitor to browse for that association, but it would be sweeter if I could script an automated detection process.

Issues I have encountered in the past include changing drive associations due to removable devices coming and going and user-defined associations that are not in sequence with existing drives, i.e. A (floppy),C (HDD),D (HDD),V (CD).