Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Burn a CD-R without using a temporary image' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Burn a CD-R without using a temporary image
Authored by: clith on Dec 18, '03 01:00:46PM
And here is the perlocratic response:
#!/usr/bin/perl

if(@ARGV < 1 || @ARGV > 2) {
	warn "Usage: burndir directory [cd name]\n";
	exit 1;
}

# detect superdrive or cd burner
chomp($drive = `system_profiler SPIDEDataType | grep DVD-RW`);
$burnerType = ((length $drive == 0) ? "IOCompactDiscServices" : "IODVDServices");

# get variables
$dir = shift;
$cdname = shift;
$cdname = $dir unless $cdname;
$cdname =~ s#.*/##;

# burn the sucker
system "mkisofs -V \"${cdname}\" -J -r \"${dir}\" | cdrecord dev=${burnerType} -v -", "\n";
Note, also, that you can get cdrecord using OpenDarwin's "port" command:
    port install cdrtools

Enjoy

[ Reply to This | # ]

Burn a CD-R without using a temporary image
Authored by: omnivector on Dec 19, '03 01:46:10AM

your script doesn't handle the burndir . option correctly (hence why i use File.expand_path)

plus it's written in nasty, nasty perl :)

---
- Tristan



[ Reply to This | # ]
Burn a CD-R without using a temporary image
Authored by: bluehz on Dec 21, '03 12:06:53AM

Sure seems to take a long time to pull from that System Profile bit. Could you get the necessary info from here...

cdrecord dev=IODVDServices -atip

or

cdrecord dev=IOCompactDiscServices -atip



[ Reply to This | # ]
Burn a CD-R without using a temporary image
Authored by: omnivector on Dec 21, '03 03:16:05AM

i agree that it takes awhile. however it's a small price to pay for burning a cd which usually takes a few minutes.

your method may work, but it didn't when i tried as a user. it might work with sudo but then the user would have to type their password in.

---
- Tristan



[ Reply to This | # ]