extproc perl -S
#!/usr/bin/perl -w
# Small perl script to burn a directory on hdd to dvd media using dvddao and mkisofs.

use strict;

# edit the following two lines for your environment and preferences
my $mkisofs = "mkisofs.exe -J -v -joliet-long";
my $dvddao = "dvddao.exe -d 1,4,0 --lock l";

my $dir = shift;
die "Usage: burn.pl <directory to burn>" if !defined $dir or $dir eq '';

open IN, "$mkisofs -print-size $dir 2>/dev/null |" or die "Cant run mkisofs";
$_ = <IN>;
close IN;
chomp;
die "Malformed mkisofs response <$_>"  if !/^(\d+)\s*$/;
system "$mkisofs $dir | $dvddao -S ${1}s -";
