Re: opening the cd rom
by ambrus (Abbot) on Oct 03, 2004 at 20:10 UTC
|
Forgetting about the web part of the question first, let me note how to open the cdrom from a locally run program, in linux. I show this just because it's not obvious even this way.
{
use Fcntl; sysopen my $f, "/dev/hdc", O_RDONLY|O_NONBLOCK or die "open
+ $?";
ioctl $f, 0x5309, 0 or die "ioctl $!";
}
The trick here is to use O_NONBLOCK.
You have to substitute "/dev/hdc" with the actual cdrom device of course. You can probably find it out with the {set,get,end}fsent C functions, but I don't know how to access those from perl.
| [reply] [d/l] [select] |
Re: opening the cd rom
by TedPride (Priest) on Oct 03, 2004 at 20:24 UTC
|
CGI: (Common Gateway Interface) -- A set of rules that describe how a Web Server communicates with another piece of software on the same machine, and how the other piece of software (the 'CGI program') talks to the web server.
CGI scripts are run on the server, and have no control over the client. Therefore, you can't use CGI to make your computer do things. | [reply] |
Re: opening the cd rom
by tachyon (Chancellor) on Oct 03, 2004 at 23:58 UTC
|
...could this be done in CGI?
No, this sort of code expliots security holes, primarily in Microsoft's ActiveX technology, but also in Java and other Plugins. Javascript has essentially no Operating System access by design and while it can do some very annoying stuff is *mostly harmless*. See this article for some background.
The latest security hole is in M$ handling of JPEG files. See this article Or just go have a look at this image ;-)
LOL
You think? Perhaps it is amusing that the World's largest software company releases software that lets anyone anywhere do anything to your PC.
| [reply] |
|
| [reply] |
|
++ Fletch!
-Theo-
(so many nodes and so little time ... )
| [reply] |
Re: opening the cd rom
by zakzebrowski (Curate) on Oct 03, 2004 at 20:21 UTC
|
It was not CGI, it was vbscript as I recall. CGI is basically any script which produces a web page. Therefore, CGI is lower level than VB script or javascript, which is only rendered by the browser at view time. Also, CGI is not necesiarially perl. It could be (pick language of choice:) asp/jsp/c/bash/cpp. Cheers.
| [reply] |
Re: opening the cd rom
by pg (Canon) on Oct 04, 2004 at 02:16 UTC
|
As to open CDROM, you can call win api: (This is not about CGI ;-)
use Win32::API;
use strict;
use warnings;
my $f = Win32::API->new("winmm", "mciSendString", "PPNN", "N");
my $ret = ' ' x 127;
my $return = $f->Call('set CDAudio door open', $ret, 127, 0);
| [reply] [d/l] |
|
| [reply] |
|
That's just plain wicked, Fletch. I love it!
| [reply] |
Re: opening the cd rom
by talexb (Chancellor) on Oct 03, 2004 at 22:03 UTC
|
I heard about that from my stepson Matt -- he was in a chat room and some l33t d00d was doing that to all of the people in the room. Except for Matt.
d00D: Hey! You're not running windows, are you?
Matt: Nope -- Mandrake 10. ;)
That definitely put a smile on *my* face.
Alex / talexb / Toronto
"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds
| [reply] |
Re: opening the cd rom
by sgifford (Prior) on Oct 04, 2004 at 04:52 UTC
|
Something like this might work:
print "Content-type: text/html\n\n";
print "<h1><blink>Press CD-ROM Eject Button Now!</blink></h1>\n";
| [reply] [d/l] |
Re: opening the cd rom
by muba (Priest) on Oct 03, 2004 at 20:05 UTC
|
I agree with the statement "users are dump/stupid/whatever". So am I. So are you. But nobody is that stupid! Everyone who uses a computer knows how to open the cd rom drive. Programs and websites should not change things unsollicited.
My $0.02.
| [reply] [d/l] |