2 # file: made to simplyfi CD/DVD burning under CLI
4 # Copyright 2009, 2010 Marcin Karpezo <sirmacik at gmail dot com>
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
28 my $isoname = "~/cd.iso";
29 my $device = "/dev/sr0";
36 GetOptions
("data=s" => \
$datadir,
37 "name=s" => \
$isoname,
38 "device=s" => \
$device,
42 "b|burn-only" => \
$burn,
43 "m|makeiso" => \
$make,
44 "h|help" => \
&helpmsg
,);
48 simpleburner, made to simplyfi CD/DVD burning under CLI
50 simpleburner Copyright (C) 2009, 2010 Marcin Karpezo
51 This program comes with ABSOLUTELY NO WARRANTY.
52 This is free software, and you are welcome
53 to redistribute it under certain conditions.
54 For details see COPYING file.
62 Simpleburner, made to simplyfi CD/DVD burning under CLI
63 Usage: simpleburner [options]
65 -h, --help Displays this message
66 --data Directory with data to burn
67 --name Path and/or name of iso image (by default ~/cd.iso)
68 --device Device to use (default /dev/sr0)
69 --speed Burning speed (by default it will be autodetected)
70 --mode Burning mode, available options are: TAO (default), DAO, SAO, RAW
71 -t, --test Run in test mode
72 -b, --burn-only Run without making iso image
73 -m, --makeiso Make only iso image
75 Please send any bug reports or feuture requests to simpleburner-bugs\@googlegroups.com
80 print("Looking for cdrkit...");
81 if (-e
'/usr/bin/wodim' and -e
'/usr/bin/genisoimage') {
83 $isomaker = 'genisoimage';
85 } elsif (-e
'/usr/bin/cdrecord' and -e
'/usr/bin/mkisofs') {
86 print("Not found\nLooking for cdrtools...");
88 $isomaker = 'mkisofs';
91 print("Not found: Please install cdrkit or cdrtools!\n");
99 print("Failed! You must define --data option.\nRun -h|--help for more information.\n");
103 unless ( -d
$datadir) {
104 print("Failed! Data directory '$datadir' does not exist.\n");
113 print("Making iso image...\n");
114 $datadir =~ s/\s+/\\ /g;
115 my $command = "$isomaker -UR -quiet -allow-multidot -allow-leading-dots -iso-level 3 -o $isoname $datadir";
118 die "Can't make iso file!\n";
120 print("[OK!]\nFile stored in $isoname\n");
124 print("Burning iso...\n");
128 $burnspeed = " --speed=$speed";
130 $runtest = "--dummy";
132 my $command = "$writer --eject -vs -$mode --dev=$device $burnspeed $runtest $isoname";
133 system("$command > /dev/null");
135 die "Can't burn disc!\n";
141 print("Old iso file detected, delete it? [Y/n] "); my $reply=<STDIN
>; chomp $reply;
143 print("Burn it? [Y/n] "); my $reply=<STDIN
>; chomp $reply;
152 print("Deleting old iso file...");
160 if ($isoname =~ m/^~/) {
161 $isoname =~ s/^~/$ENV{'HOME'}/;
164 if ($datadir =~ m/^~/) {
165 $datadir =~ s/^~/$ENV{'HOME'}/;
182 # * Delete of iso image after burning, nie, 3 sty 2010, 19:04:50 CET
183 # * CD-RW cleaning, nie, 3 sty 2010, 19:05:14 CET
184 # ** Add audiocd burning 2009-10-26 21:33+0100