[mirrorbrain-commits] r7905 - /trunk/tools/scanner.pl

From: <poeml_at_mirrorbrain.org>
Date: Sat, 05 Dec 2009 12:34:51 -0000
Author: poeml
Date: Sat Dec  5 13:34:51 2009
New Revision: 7905

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7905&view=rev
Log:
mb scan:
- when scanning via FTP, filenames containing whitespace would not be
  recognized. The regular expression that parses the FTP directory listing has
  been extended. In addition, a warning is now printed when a line can't be
  parsed. This hopefully fixes issue 31.

Modified:
    trunk/tools/scanner.pl

Modified: trunk/tools/scanner.pl
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/tools/scanner.pl?rev=7905&r1=7904&r2=7905&view=diff
==============================================================================
--- trunk/tools/scanner.pl (original)
+++ trunk/tools/scanner.pl Sat Dec  5 13:34:51 2009
_at_@ -686,7 +686,8 @@
 
   my _at_r;
   for my $i (0..$#$text) {
-    if($text->[$i] =~ m/^([dl-])(.........).*\s(\d+)\s(\w\w\w\s+\d\d?\s+\d\d:?\d\d)\s+([\S]+)$/) {
+    # -rw-r--r--    1 804      804        255436 Nov 09 03:13 The Big Picture.tar.gz
+    if($text->[$i] =~ m/^([dl-])(.........).*\s(\d+)\s(\w\w\w\s+\d\d?\s+\d\d:?\d\d)\s+(\S+.*)$/) {
       my ($type, $mode, $size, $timestamp, $fname) = ($1, $2, $3, $4, $5);
       next if $fname eq "." or $fname eq "..";
 
_at_@ -747,6 +748,8 @@
           }
         }
       }
+    } else {
+      print "$identifier: line could not be parsed: $text->[$i]\n"; # if $verbose;
     }
   }
   




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Sat Dec 05 2009 - 12:34:52 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT