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


Click here to return to the 'Improved script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Improved script
Authored by: ThreeDayMonk on Feb 18, '04 05:47:51AM

Impoved to handle combo drives as well:

#!/usr/bin/env ruby

# usage error
if ARGV.length < 1 or ARGV.length > 2 then
    $stderr.puts( "Usage: burndir directory [cd name]" )
    exit( 1 )
end

# detect burner type
# super- and combo drives are "IODVDServices"
sysprof = `system_profiler SPIDEDataType`
burnerType = if sysprof =~ /DVD-RW|CD-RW\/DVD-ROM/ then
        "IODVDServices"
    else
        "IOCompactDiscServices"
    end

# get variables
dir = ARGV.shift
cdname = if ARGV.length == 0 then
        File.basename( File.expand_path( dir ) )
    else
        ARGV.shift
    end

# burn the sucker
puts( `mkisofs -V "#{cdname}" -J -r "#{dir}" | cdrecord dev=#{burnerType} -v -` )



[ Reply to This | # ]