Code for ejecting the CD-drive.

  • Follow


Can anyone give me the code in C for ejecting the CD-drive ?
Thanks in advance!

0
Reply priyasmita_guha (8) 3/17/2006 4:08:21 PM

On Friday 17 March 2006 16:08, priyasmita_guha@yahoo.co.in opined (in
<1142611701.506813.76040@p10g2000cwp.googlegroups.com>):

> Can anyone give me the code in C for ejecting the CD-drive ?
> Thanks in advance!

Yes, but not here. Ask in a group that discusses your particular OS.

-- 
BR, Vladimir
 
C'est magnifique, mais ce n'est pas l'Informatique.
                -- Bosquet [on seeing the IBM 4341]

0
Reply novine (983) 3/17/2006 4:09:49 PM


On 17 Mar 2006 08:08:21 -0800, "priyasmita_guha@yahoo.co.in"
<priyasmita_guha@yahoo.co.in> wrote:

>Can anyone give me the code in C for ejecting the CD-drive ?
>Thanks in advance!

C can't do this, you need C++ (which was in fact designed around this
specific purpose). Check any standard graduate text for CD ejecting
theory and research outcomes.
0
Reply wayne.marsh (153) 3/17/2006 4:13:34 PM

On 17 Mar 2006 08:08:21 -0800, "priyasmita_guha@yahoo.co.in"
<priyasmita_guha@yahoo.co.in> wrote:

>Can anyone give me the code in C for ejecting the CD-drive ?
>Thanks in advance!

<OT>

int main(void)
{
   t3d_open_CD_TRAY();
   return(0);
}


/* unfortunately the contents of particular t3d function do not yet
exist. If it did the function could also have been called using
atleast folllowing alias names:
   - t3d_environment_OPEN_n_CD_DRIVE
   - t3d_environment_EJECT_n_CD_DRIVE
   - t3d_environment_EJECT_CD();
   - t3d_avaa_CD_ASEMA();   //Finnish example
   - t3d_�ppna_CD_LUCKAN  //Swedish example
   - t3d_remove_CD_DISC


http://www.tele3d.com/t3d/language.pdf

t3d programming language and the structure of t3d function prototype
are now trademarks of Juuso Hukkanen. ( TM's will be donated to
charity.)


If OP can't wait, google: stdio.h "eject cd"


*/
<OT>

Juuso



0
Reply juuso_12_2003 (33) 3/17/2006 5:57:37 PM

"priyasmita_guha@yahoo.co.in" wrote:
> 
> Can anyone give me the code in C for ejecting the CD-drive ?
> Thanks in advance!

My DS-6000 will do it with:

    i = i++;

However, this doesn't work on my DS-6100.

Your system may require something else entirely.

-- 
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody        | www.hvcomputer.com |                             |
| kenbrody/at\spamcop.net | www.fptech.com     | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@gmail.com>

0
Reply kenbrody (1860) 3/17/2006 6:14:32 PM

priyasmita_guha@yahoo.co.in wrote:
> Can anyone give me the code in C for ejecting the CD-drive ?
> Thanks in advance!

    #include <stdio.h>
    int main(void) {
      printf("Please press the CD eject button on the cd-player\n"
             "Press <ENTER> when you're done.\n");
      getchar();
      printf("The CD drive has been ejected.\n");
      return 0;
    }

-- 
If you're posting through Google read <http://cfaj.freeshell.org/google>
0
Reply hexkid (576) 3/17/2006 6:17:03 PM

<priyasmita_guha@yahoo.co.in> wrote in message
news:1142611701.506813.76040@p10g2000cwp.googlegroups.com...
> Can anyone give me the code in C for ejecting the CD-drive ?
> Thanks in advance!

Sure.  The following code shows how to do a raw CD player for DOS.
http://my.execpc.com/CE/AC/geezer/software/
"play audio CD without MSCDEX"
http://my.execpc.com/CE/AC/geezer/software/cdplay.c

You didn't say Linux or Windows...  Besides, it shows you _everything_
you'll ever need to program a CD player.


Rod Pemberton


0
Reply do_not_have3 (143) 3/17/2006 7:50:59 PM

Rod Pemberton wrote:
> 
> <priyasmita_guha@yahoo.co.in> wrote in message
> news:1142611701.506813.76040@p10g2000cwp.googlegroups.com...
> > Can anyone give me the code in C for ejecting the CD-drive ?
> > Thanks in advance!
> 
> Sure.  The following code shows how to do a raw CD player for DOS.
> http://my.execpc.com/CE/AC/geezer/software/
> "play audio CD without MSCDEX"
> http://my.execpc.com/CE/AC/geezer/software/cdplay.c
> 
> You didn't say Linux or Windows...  Besides, it shows you _everything_
> you'll ever need to program a CD player.

My DS-6000 doesn't run DOS, Linux, or Windows.  Nor does it have anything
called "ATAPI", or "Interrupt 19".

-- 
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody        | www.hvcomputer.com |                             |
| kenbrody/at\spamcop.net | www.fptech.com     | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@gmail.com>

0
Reply kenbrody (1860) 3/17/2006 10:03:25 PM

Kenneth Brody <kenbrody@spamcop.net> writes:

> My DS-6000 doesn't run DOS, Linux, or Windows.  Nor does it have anything
> called "ATAPI", or "Interrupt 19".

You should really upgrade to the DS 9000.  The 6000 is ancient
history these days.
-- 
"We put [the best] Assembler programmers in a little glass case in the hallway
 near the Exit sign.  The sign on the case says, `In case of optimization
 problem, break glass.'  Meanwhile, the problem solvers are busy doing their
 work in languages most appropriate to the job at hand." --Richard Riehle
0
Reply blp (3953) 3/18/2006 4:27:15 AM

On Fri, 17 Mar 2006 16:13:34 +0000, W Marsh <wayne.marsh@gmail.com>
wrote in comp.lang.c:

> On 17 Mar 2006 08:08:21 -0800, "priyasmita_guha@yahoo.co.in"
> <priyasmita_guha@yahoo.co.in> wrote:
> 
> >Can anyone give me the code in C for ejecting the CD-drive ?
> >Thanks in advance!
> 
> C can't do this, you need C++ (which was in fact designed around this
> specific purpose). Check any standard graduate text for CD ejecting
> theory and research outcomes.

What complete and utter nonsense!

C++ cannot eject CD drives.  It can only eject C++D drives!

-- 
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
0
Reply jackklein (3932) 3/18/2006 7:31:54 PM

Jack Klein opined:

> On Fri, 17 Mar 2006 16:13:34 +0000, W Marsh <wayne.marsh@gmail.com>
> wrote in comp.lang.c:
> 
>> On 17 Mar 2006 08:08:21 -0800, "priyasmita_guha@yahoo.co.in"
>> <priyasmita_guha@yahoo.co.in> wrote:
>> 
>> >Can anyone give me the code in C for ejecting the CD-drive ?
>> >Thanks in advance!
>> 
>> C can't do this, you need C++ (which was in fact designed around
>> this specific purpose). Check any standard graduate text for CD
>> ejecting theory and research outcomes.
> 
> What complete and utter nonsense!
> 
> C++ cannot eject CD drives.  It can only eject C++D drives!

I always thought that was C++Drives. Live and learn, I say... 

-- 
BR, Vladimir
 
I once decorated my apartment entirely in ten foot salad forks!!

0
Reply novine (983) 3/18/2006 7:33:49 PM

Ben Pfaff wrote:
> 
> Kenneth Brody <kenbrody@spamcop.net> writes:
> 
> > My DS-6000 doesn't run DOS, Linux, or Windows.  Nor does it have anything
> > called "ATAPI", or "Interrupt 19".
> 
> You should really upgrade to the DS 9000.  The 6000 is ancient
> history these days.

But I've heard that I would need to change all of my "a[i] = i++" statements
to "a[i++] = i" to keep them working.

-- 
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody        | www.hvcomputer.com |                             |
| kenbrody/at\spamcop.net | www.fptech.com     | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@gmail.com>


0
Reply kenbrody (1860) 3/20/2006 2:42:00 PM

Kenneth Brody wrote:
> Ben Pfaff wrote:
>> You should really upgrade to the DS 9000.  The 6000 is ancient
>> history these days.
>
> But I've heard that I would need to change all of my "a[i] = i++" statements
> to "a[i++] = i" to keep them working.

I don't know the DS 9000 (or 6000) but you surely want to change all of
your "a[i] = i++" statements to "(++i)[a] = i" to take advantage of pre
increment *and* pre indexing :)  <== smiley noting I'm only joking

-- 
If you're posting through Google read <http://cfaj.freeshell.org/google>
0
Reply hexkid (576) 3/20/2006 8:17:04 PM

Pedro Graca opined:

> Kenneth Brody wrote:
>> Ben Pfaff wrote:
>>> You should really upgrade to the DS 9000.  The 6000 is ancient
>>> history these days.
>>
>> But I've heard that I would need to change all of my "a[i] = i++"
>> statements to "a[i++] = i" to keep them working.
> 
> I don't know the DS 9000 (or 6000) but you surely want to change all
> of your "a[i] = i++" statements to "(++i)[a] = i" to take advantage
> of pre
> increment *and* pre indexing :)  <== smiley noting I'm only joking

One *never* jokes in the same breath one mentions DS9K (or 6K).

-- 
BR, Vladimir
 
An acid is like a woman:  a good one will eat through your pants.
                -- Mel Gibson, Saturday Night Live

0
Reply novine (983) 3/20/2006 8:49:46 PM

Vladimir S. Oka wrote:
> Pedro Graca opined:
>
> > Kenneth Brody wrote:
> >> Ben Pfaff wrote:
> >>> You should really upgrade to the DS 9000.  The 6000 is ancient
> >>> history these days.
> >>
> >> But I've heard that I would need to change all of my "a[i] = i++"
> >> statements to "a[i++] = i" to keep them working.
> >
> > I don't know the DS 9000 (or 6000) but you surely want to change all
> > of your "a[i] = i++" statements to "(++i)[a] = i" to take advantage
> > of pre
> > increment *and* pre indexing :)  <== smiley noting I'm only joking
>
> One *never* jokes in the same breath one mentions DS9K (or 6K).

Oops, I've even resorted to Google Groups to atone for my sin.

0
Reply hexkid1 (17) 3/20/2006 9:35:03 PM

Pedro Graca wrote:
> I don't know the DS 9000 (or 6000)

This was a tough one to find
but worth every minute once I found it :)


[ the void's and comment delimiters are mine ]

    /* Commence Launch (Remote Systems Console Request) */
    void clrscr(void);


-- 
If you're posting through Google read <http://cfaj.freeshell.org/google>
0
Reply hexkid (576) 3/21/2006 12:17:04 AM

15 Replies
122 Views

(page loaded in 0.216 seconds)

Similiar Articles:


















7/18/2012 7:00:23 AM


Reply: