diff --git a/tools/resample_session.pl b/tools/resample_session.pl index eadc536985..60bb212b62 100755 --- a/tools/resample_session.pl +++ b/tools/resample_session.pl @@ -99,15 +99,17 @@ while ( my $file=readdir(DOT_ARDOUR) ) { } close(DOT_ARDOUR); -# Read the names of all automation files in /automation/ -opendir(AUTOMATION,$sourceDirectory."/automation/") || die ($sourceDirectory."/automation: could not open!"); -while ( my $file=readdir(AUTOMATION) ) { - if ( -f $sourceDirectory."/automation/".$file && - index($file,".automation") eq (length($file)-11)) { - push(@automation,$file); +if ( -d $sourceDirectory."/automation/") { + # Read the names of all automation files in /automation/ + opendir(AUTOMATION,$sourceDirectory."/automation/") || die ($sourceDirectory."/automation: could not open!"); + while ( my $file=readdir(AUTOMATION) ) { + if ( -f $sourceDirectory."/automation/".$file && + index($file,".automation") eq (length($file)-11)) { + push(@automation,$file); + } } + close(AUTOMATION); } -close(AUTOMATION); # Check for /peaks/ if ( ! -d $sourceDirectory."/peaks" ) {