French translation update - fixes
[ardour.git] / tools / resample_session.pl
index c6a390f480c27d86f93a4f693f05d2f2cf989f08..60bb212b62d4ce3f452cb448730deb777fde9ab9 100755 (executable)
@@ -9,6 +9,8 @@
 # The peakfiles and dead_sounds aren't copied. Only "identified" files are copied, instant.xml's
 # or .bak's aren't copied either.
 
+use FindBin '$Bin';
+use lib "$Bin";
 use XML::Parser::PerlSAX;
 use XML::Handler::XMLWriter;
 use IO::Handle;
@@ -97,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" ) {