|
|
How to eject a CD via the Terminal in 10.2?
|
|
|
|
Forum Regular
Join Date: Jun 2003
Status:
Offline
|
|
In Linux, when you type eject in the Terminal, the CD tray opens, and when you type eject �t the CD tray closes. I tried both commands in 10.2.6, and neither of them worked. In OS 10.2, is there a command to eject the CD? My iMac has slot loading CD drive, could that be why it�s working?
|
|
|
|
|
|
|
|
|
Admin Emeritus
Join Date: Nov 2000
Location: New Yawk
Status:
Offline
|
|
Not sure you can do this in 10.2...at least I can't see anything that would do it.
|
"Do not be too positive about things. You may be in error." (C. F. Lawlor, The Mixicologist)
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status:
Offline
|
|
On 10.1, one can issue:
disktool -o
On 10.2, you can issue this command to enable the GUI Eject menubar item:
open "/System/Library/CoreServices/Menu Extras/Eject.menu"
Here's fink's eject package perl script:
Code:
#!/usr/bin/perl
$device = $ARGV[0] || "/dev/disk1";
$device =~ s/cdrom/disk1/;
exec "/usr/bin/hdiutil eject $device";
|
|
|
|
|
|
|
|
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
Originally posted by gatorparrots:
On 10.2, you can issue this command to enable the GUI Eject menubar item:
open "/System/Library/CoreServices/Menu Extras/Eject.menu"
that doesn't exactly eject the cd though, does it...
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status:
Offline
|
|
Originally posted by gatorparrots:
Here's fink's eject package perl script:
Code:
#!/usr/bin/perl
$device = $ARGV[0] || "/dev/disk1";
$device =~ s/cdrom/disk1/;
exec "/usr/bin/hdiutil eject $device";
Two questions:
1) What does the "=~" notation mean?
2) Is that "s/cdrom/disk1/" a sed-typed replace function?
|
"In Nomine Patris, Et Fili, Et Spiritus Sancti"
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 2001
Status:
Offline
|
|
To eject a CD in Mac OS X you simply type:
disktool -e disk1
Of course if your CD drive is /dev/disk3 you use disk3 there. Make it an alias and call it eject or whatever you like. Starting a perl script for that is like shooting ants with cannons.
Unlike in other operating systems there is no /dev/cdrom - does anyone know how to find out which drive(s) are CD/DVD-ROMs or ejectable?
-
|
|
|
|
|
|
|
|
|
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status:
Offline
|
|
Originally posted by Moonray:
To eject a CD in Mac OS X you simply type:
disktool -e disk1
Of course if your CD drive is /dev/disk3 you use disk3 there. Make it an alias and call it eject or whatever you like. Starting a perl script for that is like shooting ants with cannons.
Unlike in other operating systems there is no /dev/cdrom - does anyone know how to find out which drive(s) are CD/DVD-ROMs or ejectable?
-
If you have disc inside, type "df". In my case, it shows a number of lines related to all currently mounted drives. Among mine, there is currently one line like this:
/dev/disk1s1s2 678832 678832 0 100% /Volumes/MOO3 Play Disc
"MOO3 Play Disc" is a CD that I have mounted, so "disk1" is a CD (or rather, DVD).
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Jun 2003
Status:
Offline
|
|
Thanks everyone!
disktool -e disk1
Worked and when i typed disk2 it ejected my firewire CD-R tray, but it only works when there is a CD in the tray.
Also, is there a command to close the tray on my firewire CD-R?
|
|
|
|
|
|
|
|
|
Admin Emeritus
Join Date: Nov 2000
Location: New Yawk
Status:
Offline
|
|
Oh, good one. Forgot that disktool doesn't have a manpage...
|
"Do not be too positive about things. You may be in error." (C. F. Lawlor, The Mixicologist)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|