Changeset 433 for trunk/gsdl/perllib/plugins/GMLPlug.pm
- Timestamp:
- 1999-08-04T17:23:41+12:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/GMLPlug.pm
r317 r433 47 47 48 48 # see if this is a gml book 49 return undef unless (-f $fullname && $fullname =~ /\.gml $/i);49 return undef unless (-f $fullname && $fullname =~ /\.gml(\.gz)?$/i); 50 50 51 my ($parent_dir) = $fullname =~ /^(.*)\/[^\/]+.gml$/; 51 my ($parent_dir, $gz) = $fullname =~ /^(.*)\/[^\/]+.gml(\.gz)?$/i; 52 53 if (defined $gz && $gz =~ /\.gz/i) { 54 $gz = 1; 55 } else { 56 $gz = 0; 57 } 52 58 53 59 # create a new document … … 60 66 my $gml = ""; 61 67 my $line = ""; 62 if (!open (INFILE, $fullname)) { 63 print STDERR "GMLPlug::read - couldn't read $fullname\n"; 64 return undef; 68 69 if ($gz) { 70 if (!open (INFILE, "zcat $fullname |")) { 71 print STDERR "GMLPlug::read - zcat couldn't read $fullname\n"; 72 return undef; 73 } 74 } else { 75 if (!open (INFILE, $fullname)) { 76 print STDERR "GMLPlug::read - couldn't read $fullname\n"; 77 return undef; 78 } 65 79 } 80 66 81 while (defined ($line = <INFILE>)) { 67 82 $gml .= $line;
Note:
See TracChangeset
for help on using the changeset viewer.