|
Lines 14-20
Link Here
|
| 14 |
# This software is provided "as is" without express or implied warranty. |
14 |
# This software is provided "as is" without express or implied warranty. |
| 15 |
# |
15 |
# |
| 16 |
# Parse "ls -lR" type listings |
16 |
# Parse "ls -lR" type listings |
| 17 |
# use lsparse'reset( dirname ) repeately |
17 |
# use lsparse::reset( dirname ) repeately |
| 18 |
# |
18 |
# |
| 19 |
# By Lee McLoughlin <lmjm@icparc.ic.ac.uk> |
19 |
# By Lee McLoughlin <lmjm@icparc.ic.ac.uk> |
| 20 |
# |
20 |
# |
|
Lines 61-78
Link Here
|
| 61 |
local( $match ); |
61 |
local( $match ); |
| 62 |
|
62 |
|
| 63 |
# The filestore type being scanned |
63 |
# The filestore type being scanned |
| 64 |
$lsparse'fstype = 'unix'; |
64 |
$lsparse::fstype = 'unix'; |
| 65 |
|
65 |
|
| 66 |
# Keep whatever case is on the remote system. Otherwise lowercase it. |
66 |
# Keep whatever case is on the remote system. Otherwise lowercase it. |
| 67 |
$lsparse'vms_keep_case = ''; |
67 |
$lsparse::vms_keep_case = ''; |
| 68 |
|
68 |
|
| 69 |
# A name to report when errors occur |
69 |
# A name to report when errors occur |
| 70 |
$lsparse'name = 'unknown'; |
70 |
$lsparse::name = 'unknown'; |
| 71 |
|
71 |
|
| 72 |
# Wether to report subdirs when finding them in a directory |
72 |
# Wether to report subdirs when finding them in a directory |
| 73 |
# or when their details appear. (If you report early then mirro might |
73 |
# or when their details appear. (If you report early then mirro might |
| 74 |
# recreate locally remote restricted directories.) |
74 |
# recreate locally remote restricted directories.) |
| 75 |
$lsparse'report_subdir = 0; # Report when finding details. |
75 |
$lsparse::report_subdir = 0; # Report when finding details. |
| 76 |
|
76 |
|
| 77 |
|
77 |
|
| 78 |
# Name of routine to call to parse incoming listing lines |
78 |
# Name of routine to call to parse incoming listing lines |
|
Lines 81-87
Link Here
|
| 81 |
# Set the directory that is being scanned and |
81 |
# Set the directory that is being scanned and |
| 82 |
# check that the scan routing for this fstype exists |
82 |
# check that the scan routing for this fstype exists |
| 83 |
# returns false if the fstype is unknown. |
83 |
# returns false if the fstype is unknown. |
| 84 |
sub lsparse'reset |
84 |
sub lsparse::reset |
| 85 |
{ |
85 |
{ |
| 86 |
$here = $currdir = $_[0]; |
86 |
$here = $currdir = $_[0]; |
| 87 |
$now = time; |
87 |
$now = time; |
|
Lines 91-107
Link Here
|
| 91 |
$vms_strip =~ s,^/+,,; |
91 |
$vms_strip =~ s,^/+,,; |
| 92 |
$vms_strip =~ s,/+$,,; |
92 |
$vms_strip =~ s,/+$,,; |
| 93 |
|
93 |
|
| 94 |
$ls_line = "lsparse'line_$fstype"; |
94 |
$ls_line = "lsparse::line_$fstype"; |
| 95 |
return( defined( &$ls_line ) ); |
95 |
return( defined( &$ls_line ) ); |
| 96 |
} |
96 |
} |
| 97 |
|
97 |
|
| 98 |
# See line_unix following routine for call/return details. |
98 |
# See line_unix following routine for call/return details. |
| 99 |
# This calls the filestore specific parser. |
99 |
# This calls the filestore specific parser. |
| 100 |
sub lsparse'line |
100 |
sub lsparse::line |
| 101 |
{ |
101 |
{ |
| 102 |
local( $fh ) = @_; |
102 |
local( $fh ) = @_; |
| 103 |
|
103 |
|
| 104 |
# ls_line is setup in lsparse'reset to the name of the function |
104 |
# ls_line is setup in lsparse::reset to the name of the function |
| 105 |
local( $path, $size, $time, $type, $mode ) = |
105 |
local( $path, $size, $time, $type, $mode ) = |
| 106 |
eval "&$ls_line( \$fh )"; |
106 |
eval "&$ls_line( \$fh )"; |
| 107 |
|
107 |
|
|
Lines 119-125
Link Here
|
| 119 |
# time is a Un*x time value for the file |
119 |
# time is a Un*x time value for the file |
| 120 |
# type is "f" for a file, "d" for a directory and |
120 |
# type is "f" for a file, "d" for a directory and |
| 121 |
# "l linkname" for a symlink |
121 |
# "l linkname" for a symlink |
| 122 |
sub lsparse'line_unix |
122 |
sub lsparse::line_unix |
| 123 |
{ |
123 |
{ |
| 124 |
local( $fh ) = @_; |
124 |
local( $fh ) = @_; |
| 125 |
local( $non_crud, $perm_denied ); |
125 |
local( $non_crud, $perm_denied ); |
|
Lines 132-138
Link Here
|
| 132 |
|
132 |
|
| 133 |
while( <$fh> ){ |
133 |
while( <$fh> ){ |
| 134 |
# Store listing |
134 |
# Store listing |
| 135 |
print main'STORE $_; |
135 |
print main::STORE $_; |
| 136 |
|
136 |
|
| 137 |
# Stomp on carriage returns |
137 |
# Stomp on carriage returns |
| 138 |
s/\015//g; |
138 |
s/\015//g; |
|
Lines 168-174
Link Here
|
| 168 |
if( $perm_denied ){ |
168 |
if( $perm_denied ){ |
| 169 |
$perm_denied = ""; |
169 |
$perm_denied = ""; |
| 170 |
warn "Warning: input corrupted by 'Permission denied'", |
170 |
warn "Warning: input corrupted by 'Permission denied'", |
| 171 |
"errors, about line $. of $lsparse'name\n"; |
171 |
"errors, about line $. of $lsparse::name\n"; |
| 172 |
next; |
172 |
next; |
| 173 |
} |
173 |
} |
| 174 |
# Not found's are like Permission denied's. They can start part |
174 |
# Not found's are like Permission denied's. They can start part |
|
Lines 180-186
Link Here
|
| 180 |
if( $not_found ){ |
180 |
if( $not_found ){ |
| 181 |
$not_found = ""; |
181 |
$not_found = ""; |
| 182 |
warn "Warning: input corrupted by 'not found' errors", |
182 |
warn "Warning: input corrupted by 'not found' errors", |
| 183 |
" about line $. of $lsparse'name\n"; |
183 |
" about line $. of $lsparse::name\n"; |
| 184 |
next; |
184 |
next; |
| 185 |
} |
185 |
} |
| 186 |
|
186 |
|
|
Lines 196-202
Link Here
|
| 196 |
next; |
196 |
next; |
| 197 |
} |
197 |
} |
| 198 |
|
198 |
|
| 199 |
local( $time ) = &main'lstime_to_time( $lsdate ); |
199 |
local( $time ) = &main::lstime_to_time( $lsdate ); |
| 200 |
local( $type ) = '?'; |
200 |
local( $type ) = '?'; |
| 201 |
local( $mode ) = 0; |
201 |
local( $mode ) = 0; |
| 202 |
|
202 |
|
|
Lines 316-322
Link Here
|
| 316 |
# time is a Un*x time value for the file |
316 |
# time is a Un*x time value for the file |
| 317 |
# type is "f" for a file, "d" for a directory and |
317 |
# type is "f" for a file, "d" for a directory and |
| 318 |
# "l linkname" for a symlink |
318 |
# "l linkname" for a symlink |
| 319 |
sub lsparse'line_dls |
319 |
sub lsparse::line_dls |
| 320 |
{ |
320 |
{ |
| 321 |
local( $fh ) = @_; |
321 |
local( $fh ) = @_; |
| 322 |
local( $non_crud, $perm_denied ); |
322 |
local( $non_crud, $perm_denied ); |
|
Lines 327-333
Link Here
|
| 327 |
|
327 |
|
| 328 |
while( <$fh> ){ |
328 |
while( <$fh> ){ |
| 329 |
# Store listing |
329 |
# Store listing |
| 330 |
print main'STORE $_; |
330 |
print main::STORE $_; |
| 331 |
|
331 |
|
| 332 |
# Stomp on carriage returns |
332 |
# Stomp on carriage returns |
| 333 |
s/\015//g; |
333 |
s/\015//g; |
|
Lines 350-356
Link Here
|
| 350 |
} |
350 |
} |
| 351 |
else { |
351 |
else { |
| 352 |
# a file |
352 |
# a file |
| 353 |
$time = &main'lstime_to_time( $lsdate ); |
353 |
$time = &main::lstime_to_time( $lsdate ); |
| 354 |
$type = 'f'; |
354 |
$type = 'f'; |
| 355 |
$mode = 0444; |
355 |
$mode = 0444; |
| 356 |
} |
356 |
} |
|
Lines 400-406
Link Here
|
| 400 |
# time is a Un*x time value for the file |
400 |
# time is a Un*x time value for the file |
| 401 |
# type is "f" for a file, "d" for a directory and |
401 |
# type is "f" for a file, "d" for a directory and |
| 402 |
# "l linkname" for a symlink |
402 |
# "l linkname" for a symlink |
| 403 |
sub lsparse'line_netware |
403 |
sub lsparse::line_netware |
| 404 |
{ |
404 |
{ |
| 405 |
local( $fh ) = @_; |
405 |
local( $fh ) = @_; |
| 406 |
|
406 |
|
|
Lines 410-416
Link Here
|
| 410 |
|
410 |
|
| 411 |
while( <$fh> ){ |
411 |
while( <$fh> ){ |
| 412 |
# Store listing |
412 |
# Store listing |
| 413 |
print main'STORE $_; |
413 |
print main::STORE $_; |
| 414 |
|
414 |
|
| 415 |
# Stomp on carriage returns |
415 |
# Stomp on carriage returns |
| 416 |
s/\015//g; |
416 |
s/\015//g; |
|
Lines 435-441
Link Here
|
| 435 |
if( $file eq '.' || $file eq '..' ){ |
435 |
if( $file eq '.' || $file eq '..' ){ |
| 436 |
next; |
436 |
next; |
| 437 |
} |
437 |
} |
| 438 |
local( $time ) = &main'lstime_to_time( $lsdate ); |
438 |
local( $time ) = &main::lstime_to_time( $lsdate ); |
| 439 |
local( $type ) = '?'; |
439 |
local( $type ) = '?'; |
| 440 |
local( $mode ) = 0; |
440 |
local( $mode ) = 0; |
| 441 |
|
441 |
|
|
Lines 509-515
Link Here
|
| 509 |
# time is a Un*x time value for the file |
509 |
# time is a Un*x time value for the file |
| 510 |
# type is "f" for a file, "d" for a directory and |
510 |
# type is "f" for a file, "d" for a directory and |
| 511 |
# "l linkname" for a symlink |
511 |
# "l linkname" for a symlink |
| 512 |
sub lsparse'line_vms |
512 |
sub lsparse::line_vms |
| 513 |
{ |
513 |
{ |
| 514 |
local( $fh ) = @_; |
514 |
local( $fh ) = @_; |
| 515 |
local( $non_crud, $perm_denied ); |
515 |
local( $non_crud, $perm_denied ); |
|
Lines 520-526
Link Here
|
| 520 |
|
520 |
|
| 521 |
while( <$fh> ){ |
521 |
while( <$fh> ){ |
| 522 |
# Store listing |
522 |
# Store listing |
| 523 |
print main'STORE $_; |
523 |
print main::STORE $_; |
| 524 |
|
524 |
|
| 525 |
# Stomp on carriage returns |
525 |
# Stomp on carriage returns |
| 526 |
s/\015//g; |
526 |
s/\015//g; |
|
Lines 543-549
Link Here
|
| 543 |
} |
543 |
} |
| 544 |
|
544 |
|
| 545 |
# Upper case is so ugly |
545 |
# Upper case is so ugly |
| 546 |
if( ! $lsparse'vms_keep_case ){ |
546 |
if( ! $lsparse::vms_keep_case ){ |
| 547 |
tr/A-Z/a-z/; |
547 |
tr/A-Z/a-z/; |
| 548 |
} |
548 |
} |
| 549 |
|
549 |
|
|
Lines 584-590
Link Here
|
| 584 |
$size = 0; |
584 |
$size = 0; |
| 585 |
|
585 |
|
| 586 |
if( $got ){ |
586 |
if( $got ){ |
| 587 |
local( $time ) = &main'lstime_to_time( $lsdate ); |
587 |
local( $time ) = &main::lstime_to_time( $lsdate ); |
| 588 |
local( $type ) = 'f'; |
588 |
local( $type ) = 'f'; |
| 589 |
local( $mode ) = 0444; |
589 |
local( $mode ) = 0444; |
| 590 |
|
590 |
|
|
Lines 610-616
Link Here
|
| 610 |
$mode = 0555; |
610 |
$mode = 0555; |
| 611 |
} |
611 |
} |
| 612 |
|
612 |
|
| 613 |
$lsparse'vers = $vers; |
613 |
$lsparse::vers = $vers; |
| 614 |
|
614 |
|
| 615 |
#print "file=|$file| match=|$match| vms_strip=|$vms_strip|\n"; |
615 |
#print "file=|$file| match=|$match| vms_strip=|$vms_strip|\n"; |
| 616 |
$file =~ s,^,/,; |
616 |
$file =~ s,^,/,; |
|
Lines 653-659
Link Here
|
| 653 |
# time is a Un*x time value for the file |
653 |
# time is a Un*x time value for the file |
| 654 |
# type is "f" for a file, "d" for a directory and |
654 |
# type is "f" for a file, "d" for a directory and |
| 655 |
# "l linkname" for a symlink |
655 |
# "l linkname" for a symlink |
| 656 |
sub lsparse'line_dosftp |
656 |
sub lsparse::line_dosftp |
| 657 |
{ |
657 |
{ |
| 658 |
local( $fh ) = @_; |
658 |
local( $fh ) = @_; |
| 659 |
|
659 |
|
|
Lines 670-676
Link Here
|
| 670 |
$_ = <$fh>; |
670 |
$_ = <$fh>; |
| 671 |
|
671 |
|
| 672 |
# Store listing |
672 |
# Store listing |
| 673 |
print main'STORE $_; |
673 |
print main::STORE $_; |
| 674 |
|
674 |
|
| 675 |
# Ignore the summary at the end and blank lines |
675 |
# Ignore the summary at the end and blank lines |
| 676 |
if( /^\d+ files?\./ || /^\s+$/ ){ |
676 |
if( /^\d+ files?\./ || /^\s+$/ ){ |
|
Lines 691-697
Link Here
|
| 691 |
|
691 |
|
| 692 |
# TODO: fix hacky 19$yr |
692 |
# TODO: fix hacky 19$yr |
| 693 |
local( $lsdate ) = "$day-$mon-19$yr $hrs:$min"; |
693 |
local( $lsdate ) = "$day-$mon-19$yr $hrs:$min"; |
| 694 |
local( $time ) = &main'lstime_to_time( $lsdate ); |
694 |
local( $time ) = &main::lstime_to_time( $lsdate ); |
| 695 |
local( $type ) = '?'; |
695 |
local( $type ) = '?'; |
| 696 |
local( $mode ) = 0; |
696 |
local( $mode ) = 0; |
| 697 |
|
697 |
|
|
Lines 736-742
Link Here
|
| 736 |
# 03-08-94 07:17AM 5504 article.xfiles.intro |
736 |
# 03-08-94 07:17AM 5504 article.xfiles.intro |
| 737 |
# 02-28-94 11:44AM 3262 article1.gillian.anderson |
737 |
# 02-28-94 11:44AM 3262 article1.gillian.anderson |
| 738 |
|
738 |
|
| 739 |
sub lsparse'line_dosish |
739 |
sub lsparse::line_dosish |
| 740 |
{ |
740 |
{ |
| 741 |
local( $fh ) = @_; |
741 |
local( $fh ) = @_; |
| 742 |
|
742 |
|
|
Lines 748-754
Link Here
|
| 748 |
$_ = <$fh>; |
748 |
$_ = <$fh>; |
| 749 |
|
749 |
|
| 750 |
# Store listing |
750 |
# Store listing |
| 751 |
print main'STORE $_; |
751 |
print main::STORE $_; |
| 752 |
|
752 |
|
| 753 |
# Ignore blank lines |
753 |
# Ignore blank lines |
| 754 |
if( /^\s+$/ ){ |
754 |
if( /^\s+$/ ){ |
|
Lines 775-781
Link Here
|
| 775 |
|
775 |
|
| 776 |
# TODO: fix hacky 19$yr |
776 |
# TODO: fix hacky 19$yr |
| 777 |
local( $lsdate ) = "$day-$mon-19$yr $hrs:$min"; |
777 |
local( $lsdate ) = "$day-$mon-19$yr $hrs:$min"; |
| 778 |
local( $time ) = &main'lstime_to_time( $lsdate ); |
778 |
local( $time ) = &main::lstime_to_time( $lsdate ); |
| 779 |
local( $type ) = ($dir_or_size eq '<DIR>' ? 'd' : 'f'); |
779 |
local( $type ) = ($dir_or_size eq '<DIR>' ? 'd' : 'f'); |
| 780 |
local( $mode ) = 0; |
780 |
local( $mode ) = 0; |
| 781 |
local( $size ) = 0; |
781 |
local( $size ) = 0; |
|
Lines 842-848
Link Here
|
| 842 |
# WPKIT1.EXE 960338 06/21/95 17:01 |
842 |
# WPKIT1.EXE 960338 06/21/95 17:01 |
| 843 |
# CMT.CSV 0 07/06/95 14:56 |
843 |
# CMT.CSV 0 07/06/95 14:56 |
| 844 |
|
844 |
|
| 845 |
sub lsparse'line_supertcp |
845 |
sub lsparse::line_supertcp |
| 846 |
{ |
846 |
{ |
| 847 |
local( $fh ) = @_; |
847 |
local( $fh ) = @_; |
| 848 |
|
848 |
|
|
Lines 860-866
Link Here
|
| 860 |
$_ = <$fh>; |
860 |
$_ = <$fh>; |
| 861 |
|
861 |
|
| 862 |
# Store listing |
862 |
# Store listing |
| 863 |
print main'STORE $_; |
863 |
print main::STORE $_; |
| 864 |
|
864 |
|
| 865 |
# Ignore the summary at the end and blank lines |
865 |
# Ignore the summary at the end and blank lines |
| 866 |
if( /^\d+ files?\./ || /^\s+$/ ){ |
866 |
if( /^\d+ files?\./ || /^\s+$/ ){ |
|
Lines 885-891
Link Here
|
| 885 |
$pending = $5; |
885 |
$pending = $5; |
| 886 |
|
886 |
|
| 887 |
local( $lsdate ) = "$day-$mon-$yr $time"; |
887 |
local( $lsdate ) = "$day-$mon-$yr $time"; |
| 888 |
local( $time ) = &main'lstime_to_time( $lsdate ); |
888 |
local( $time ) = &main::lstime_to_time( $lsdate ); |
| 889 |
local( $type ) = '?'; |
889 |
local( $type ) = '?'; |
| 890 |
local( $mode ) = 0; |
890 |
local( $mode ) = 0; |
| 891 |
|
891 |
|
|
Lines 931-937
Link Here
|
| 931 |
# 372 A 08-09-95 10:26 Aussie_1.bag |
931 |
# 372 A 08-09-95 10:26 Aussie_1.bag |
| 932 |
# 310992 06-28-94 09:56 INSTALL.EXE |
932 |
# 310992 06-28-94 09:56 INSTALL.EXE |
| 933 |
|
933 |
|
| 934 |
sub lsparse'line_os2 |
934 |
sub lsparse::line_os2 |
| 935 |
{ |
935 |
{ |
| 936 |
local( $fh ) = @_; |
936 |
local( $fh ) = @_; |
| 937 |
|
937 |
|
|
Lines 943-949
Link Here
|
| 943 |
$_ = <$fh>; |
943 |
$_ = <$fh>; |
| 944 |
|
944 |
|
| 945 |
# Store listing |
945 |
# Store listing |
| 946 |
print main'STORE $_; |
946 |
print main::STORE $_; |
| 947 |
|
947 |
|
| 948 |
# Ignore blank lines |
948 |
# Ignore blank lines |
| 949 |
if( /^\s+$/ ){ |
949 |
if( /^\s+$/ ){ |
|
Lines 971-977
Link Here
|
| 971 |
|
971 |
|
| 972 |
# TODO: fix hacky 19$yr |
972 |
# TODO: fix hacky 19$yr |
| 973 |
local( $lsdate ) = "$day-$mon-19$yr $hrs:$min"; |
973 |
local( $lsdate ) = "$day-$mon-19$yr $hrs:$min"; |
| 974 |
local( $time ) = &main'lstime_to_time( $lsdate ); |
974 |
local( $time ) = &main::lstime_to_time( $lsdate ); |
| 975 |
local( $type ) = ($dir eq 'DIR' ? 'd' : 'f'); |
975 |
local( $type ) = ($dir eq 'DIR' ? 'd' : 'f'); |
| 976 |
local( $mode ) = 0; |
976 |
local( $mode ) = 0; |
| 977 |
|
977 |
|
|
Lines 999-1005
Link Here
|
| 999 |
# time is a Un*x time value for the file |
999 |
# time is a Un*x time value for the file |
| 1000 |
# type is "f" for a file, "d" for a directory and |
1000 |
# type is "f" for a file, "d" for a directory and |
| 1001 |
# "l linkname" for a symlink |
1001 |
# "l linkname" for a symlink |
| 1002 |
sub lsparse'line_chameleon |
1002 |
sub lsparse::line_chameleon |
| 1003 |
{ |
1003 |
{ |
| 1004 |
local( $fh ) = @_; |
1004 |
local( $fh ) = @_; |
| 1005 |
|
1005 |
|
|
Lines 1038-1044
Link Here
|
| 1038 |
$pending = $5; |
1038 |
$pending = $5; |
| 1039 |
|
1039 |
|
| 1040 |
local( $lsdate ) = "$day-$mon-$yr $time"; |
1040 |
local( $lsdate ) = "$day-$mon-$yr $time"; |
| 1041 |
local( $time ) = &main'lstime_to_time( $lsdate ); |
1041 |
local( $time ) = &main::lstime_to_time( $lsdate ); |
| 1042 |
local( $type ) = '?'; |
1042 |
local( $type ) = '?'; |
| 1043 |
local( $mode ) = 0; |
1043 |
local( $mode ) = 0; |
| 1044 |
|
1044 |
|
|
Lines 1076-1082
Link Here
|
| 1076 |
# time is a Un*x time value for the file |
1076 |
# time is a Un*x time value for the file |
| 1077 |
# type is "f" for a file, "d" for a directory and |
1077 |
# type is "f" for a file, "d" for a directory and |
| 1078 |
# "l linkname" for a symlink |
1078 |
# "l linkname" for a symlink |
| 1079 |
sub lsparse'line_macos |
1079 |
sub lsparse::line_macos |
| 1080 |
{ |
1080 |
{ |
| 1081 |
local( $fh ) = @_; |
1081 |
local( $fh ) = @_; |
| 1082 |
local( $non_crud, $perm_denied ); |
1082 |
local( $non_crud, $perm_denied ); |
|
Lines 1087-1093
Link Here
|
| 1087 |
|
1087 |
|
| 1088 |
while( <$fh> ){ |
1088 |
while( <$fh> ){ |
| 1089 |
# Store listing |
1089 |
# Store listing |
| 1090 |
print main'STORE $_; |
1090 |
print main::STORE $_; |
| 1091 |
|
1091 |
|
| 1092 |
# Stomp on carriage returns |
1092 |
# Stomp on carriage returns |
| 1093 |
s/\015//g; |
1093 |
s/\015//g; |
|
Lines 1098-1104
Link Here
|
| 1098 |
if( /^([\-rwxd]{10}).*\s(\d+\s+)?(\S+)\s+\d+\s*(\w\w\w\s+\d+\s*(\d+:\d+|\d\d\d\d))\s+(.*)\n/ ){ |
1098 |
if( /^([\-rwxd]{10}).*\s(\d+\s+)?(\S+)\s+\d+\s*(\w\w\w\s+\d+\s*(\d+:\d+|\d\d\d\d))\s+(.*)\n/ ){ |
| 1099 |
local( $kind, $size, $lsdate, $file ) = ($1, $3, $4, $6); |
1099 |
local( $kind, $size, $lsdate, $file ) = ($1, $3, $4, $6); |
| 1100 |
|
1100 |
|
| 1101 |
local( $time ) = &main'lstime_to_time( $lsdate ); |
1101 |
local( $time ) = &main::lstime_to_time( $lsdate ); |
| 1102 |
local( $type ) = '?'; |
1102 |
local( $type ) = '?'; |
| 1103 |
local( $mode ) = 0; |
1103 |
local( $mode ) = 0; |
| 1104 |
|
1104 |
|
|
Lines 1126-1143
Link Here
|
| 1126 |
|
1126 |
|
| 1127 |
|
1127 |
|
| 1128 |
# --------------------- parse lsparse log file format |
1128 |
# --------------------- parse lsparse log file format |
| 1129 |
# lsparse'line_lsparse() is for input in lsparse's internal form, |
1129 |
# lsparse::line_lsparse() is for input in lsparse::s internal form, |
| 1130 |
# as it might have been written to a log file during a previous |
1130 |
# as it might have been written to a log file during a previous |
| 1131 |
# run of a program that uses lsparse. The format is: |
1131 |
# run of a program that uses lsparse. The format is: |
| 1132 |
# filename size time type mode |
1132 |
# filename size time type mode |
| 1133 |
# where size and time are in decimal, mode is in decimal or octal, |
1133 |
# where size and time are in decimal, mode is in decimal or octal, |
| 1134 |
# and type is one or two words. |
1134 |
# and type is one or two words. |
| 1135 |
sub lsparse'line_lsparse |
1135 |
sub lsparse::line_lsparse |
| 1136 |
{ |
1136 |
{ |
| 1137 |
local( $fh ) = @_; |
1137 |
local( $fh ) = @_; |
| 1138 |
|
1138 |
|
| 1139 |
if( $lsparse'readtime ){ |
1139 |
if( $lsparse::readtime ){ |
| 1140 |
alarm( $lsparse'readtime ); |
1140 |
alarm( $lsparse::readtime ); |
| 1141 |
} |
1141 |
} |
| 1142 |
|
1142 |
|
| 1143 |
if( eof( $fh ) ){ |
1143 |
if( eof( $fh ) ){ |
|
Lines 1147-1153
Link Here
|
| 1147 |
|
1147 |
|
| 1148 |
while( <$fh> ){ |
1148 |
while( <$fh> ){ |
| 1149 |
# Store listing |
1149 |
# Store listing |
| 1150 |
print main'STORE $_; |
1150 |
print main::STORE $_; |
| 1151 |
|
1151 |
|
| 1152 |
if( /^(\S+)\s+(\d+)\s+(\d+)\s+((l\s+)?\S+)\s+(\d+)\n$/ ){ |
1152 |
if( /^(\S+)\s+(\d+)\s+(\d+)\s+((l\s+)?\S+)\s+(\d+)\n$/ ){ |
| 1153 |
# looks good. |
1153 |
# looks good. |
|
Lines 1174-1185
Link Here
|
| 1174 |
# This is the format used at sumex-aim.stanford.edu for the info-mac area. |
1174 |
# This is the format used at sumex-aim.stanford.edu for the info-mac area. |
| 1175 |
# (see info-mac/help/all-files.txt.gz). |
1175 |
# (see info-mac/help/all-files.txt.gz). |
| 1176 |
# |
1176 |
# |
| 1177 |
sub lsparse'line_infomac |
1177 |
sub lsparse::line_infomac |
| 1178 |
{ |
1178 |
{ |
| 1179 |
local( $fh ) = @_; |
1179 |
local( $fh ) = @_; |
| 1180 |
|
1180 |
|
| 1181 |
if( $lsparse'readtime ){ |
1181 |
if( $lsparse::readtime ){ |
| 1182 |
alarm( $lsparse'readtime ); |
1182 |
alarm( $lsparse::readtime ); |
| 1183 |
} |
1183 |
} |
| 1184 |
|
1184 |
|
| 1185 |
if( eof( $fh ) ){ |
1185 |
if( eof( $fh ) ){ |
|
Lines 1189-1201
Link Here
|
| 1189 |
|
1189 |
|
| 1190 |
while( <$fh> ){ |
1190 |
while( <$fh> ){ |
| 1191 |
# Store listing |
1191 |
# Store listing |
| 1192 |
print main'STORE $_; |
1192 |
print main::STORE $_; |
| 1193 |
|
1193 |
|
| 1194 |
next if /^;/; |
1194 |
next if /^;/; |
| 1195 |
if( /^([l-].)\s*(\d+)\s*(\w\w\w\s+\d+\s*(\d+:\d+|\d\d\d\d))\s+(.*)\n/ ){ |
1195 |
if( /^([l-].)\s*(\d+)\s*(\w\w\w\s+\d+\s*(\d+:\d+|\d\d\d\d))\s+(.*)\n/ ){ |
| 1196 |
local( $kind, $size, $lsdate, $file ) = ($1, $2, $3, $5); |
1196 |
local( $kind, $size, $lsdate, $file ) = ($1, $2, $3, $5); |
| 1197 |
|
1197 |
|
| 1198 |
local( $time ) = &main'lstime_to_time( $lsdate ); |
1198 |
local( $time ) = &main::lstime_to_time( $lsdate ); |
| 1199 |
|
1199 |
|
| 1200 |
# This should be a symlink |
1200 |
# This should be a symlink |
| 1201 |
if( $kind =~ /^l/ && $file =~ /(.*) -> (.*)/ ){ |
1201 |
if( $kind =~ /^l/ && $file =~ /(.*) -> (.*)/ ){ |
|
Lines 1226-1237
Link Here
|
| 1226 |
# +i8388621.48638,m848117771,r,s1336, qmsmac.html |
1226 |
# +i8388621.48638,m848117771,r,s1336, qmsmac.html |
| 1227 |
# +i8388621.88705,m850544954,/, txt |
1227 |
# +i8388621.88705,m850544954,/, txt |
| 1228 |
# |
1228 |
# |
| 1229 |
sub lsparse'line_eplf |
1229 |
sub lsparse::line_eplf |
| 1230 |
{ |
1230 |
{ |
| 1231 |
local( $fh ) = @_; |
1231 |
local( $fh ) = @_; |
| 1232 |
|
1232 |
|
| 1233 |
if( $lsparse'readtime ){ |
1233 |
if( $lsparse::readtime ){ |
| 1234 |
alarm( $lsparse'readtime ); |
1234 |
alarm( $lsparse::readtime ); |
| 1235 |
} |
1235 |
} |
| 1236 |
|
1236 |
|
| 1237 |
if( eof( $fh ) ){ |
1237 |
if( eof( $fh ) ){ |
|
Lines 1243-1249
Link Here
|
| 1243 |
s/\015//g; |
1243 |
s/\015//g; |
| 1244 |
|
1244 |
|
| 1245 |
# Store listing |
1245 |
# Store listing |
| 1246 |
print main'STORE $_; |
1246 |
print main::STORE $_; |
| 1247 |
|
1247 |
|
| 1248 |
# +i8388621.48638,m848117771,r,s1336, qmsmac.html |
1248 |
# +i8388621.48638,m848117771,r,s1336, qmsmac.html |
| 1249 |
# +i8388621.88705,m850544954,/, txt |
1249 |
# +i8388621.88705,m850544954,/, txt |
|
Lines 1272-1283
Link Here
|
| 1272 |
# --------------------- CTAN files list |
1272 |
# --------------------- CTAN files list |
| 1273 |
# 22670 Mon Jul 20 12:36:34 1992 pub/tex/biblio/bibtex/contrib/aaai-named.bst |
1273 |
# 22670 Mon Jul 20 12:36:34 1992 pub/tex/biblio/bibtex/contrib/aaai-named.bst |
| 1274 |
# |
1274 |
# |
| 1275 |
sub lsparse'line_ctan |
1275 |
sub lsparse::line_ctan |
| 1276 |
{ |
1276 |
{ |
| 1277 |
local( $fh ) = @_; |
1277 |
local( $fh ) = @_; |
| 1278 |
|
1278 |
|
| 1279 |
if( $lsparse'readtime ){ |
1279 |
if( $lsparse::readtime ){ |
| 1280 |
alarm( $lsparse'readtime ); |
1280 |
alarm( $lsparse::readtime ); |
| 1281 |
} |
1281 |
} |
| 1282 |
|
1282 |
|
| 1283 |
if( eof( $fh ) ){ |
1283 |
if( eof( $fh ) ){ |
|
Lines 1287-1298
Link Here
|
| 1287 |
|
1287 |
|
| 1288 |
while( <$fh> ){ |
1288 |
while( <$fh> ){ |
| 1289 |
# Store listing |
1289 |
# Store listing |
| 1290 |
print main'STORE $_; |
1290 |
print main::STORE $_; |
| 1291 |
|
1291 |
|
| 1292 |
if( /^\s*(\d+)\s+(\w\w\w\s+\w\w\w\s+\d+\s+\d+:\d+:\d+\s+\d+)\s+(.*)\n/ ){ |
1292 |
if( /^\s*(\d+)\s+(\w\w\w\s+\w\w\w\s+\d+\s+\d+:\d+:\d+\s+\d+)\s+(.*)\n/ ){ |
| 1293 |
local( $size, $lsdate, $file ) = ($1, $2, $3); |
1293 |
local( $size, $lsdate, $file ) = ($1, $2, $3); |
| 1294 |
|
1294 |
|
| 1295 |
local( $time ) = &main'lstime_to_time( $lsdate ); |
1295 |
local( $time ) = &main::lstime_to_time( $lsdate ); |
| 1296 |
|
1296 |
|
| 1297 |
return( $file, $size, $time, 'f', 0444 ); |
1297 |
return( $file, $size, $time, 'f', 0444 ); |
| 1298 |
} |
1298 |
} |
|
Lines 1317-1328
Link Here
|
| 1317 |
# time is a Un*x time value for the file -- this is good from the m/f |
1317 |
# time is a Un*x time value for the file -- this is good from the m/f |
| 1318 |
# type is always "f" for a file |
1318 |
# type is always "f" for a file |
| 1319 |
|
1319 |
|
| 1320 |
sub lsparse'line_cms |
1320 |
sub lsparse::line_cms |
| 1321 |
{ |
1321 |
{ |
| 1322 |
local( $fh ) = @_; |
1322 |
local( $fh ) = @_; |
| 1323 |
|
1323 |
|
| 1324 |
if( $lsparse'readtime ){ |
1324 |
if( $lsparse::readtime ){ |
| 1325 |
alarm( $lsparse'readtime ); |
1325 |
alarm( $lsparse::readtime ); |
| 1326 |
} |
1326 |
} |
| 1327 |
|
1327 |
|
| 1328 |
if( eof( $fh ) ){ |
1328 |
if( eof( $fh ) ){ |
|
Lines 1331-1351
Link Here
|
| 1331 |
} |
1331 |
} |
| 1332 |
while( <$fh> ){ |
1332 |
while( <$fh> ){ |
| 1333 |
# Store listing |
1333 |
# Store listing |
| 1334 |
print main'STORE $_; |
1334 |
print main::STORE $_; |
| 1335 |
|
1335 |
|
| 1336 |
chop; |
1336 |
chop; |
| 1337 |
next unless /\d+\/\d+\/\d+\s+\d+:\d+:\d+/; |
1337 |
next unless /\d+\/\d+\/\d+\s+\d+:\d+:\d+/; |
| 1338 |
s/^\s+//; |
1338 |
s/^\s+//; |
| 1339 |
|
1339 |
|
| 1340 |
# Upper case is so ugly |
1340 |
# Upper case is so ugly |
| 1341 |
if( ! $lsparse'vms_keep_case ){ |
1341 |
if( ! $lsparse::vms_keep_case ){ |
| 1342 |
tr/A-Z/a-z/; |
1342 |
tr/A-Z/a-z/; |
| 1343 |
} |
1343 |
} |
| 1344 |
|
1344 |
|
| 1345 |
local( $fname, $ftype, $fdisk, $rectype, $lrecl, $recs, |
1345 |
local( $fname, $ftype, $fdisk, $rectype, $lrecl, $recs, |
| 1346 |
$blocks, $ldate, $tod ) = split(/\s+/, $_); |
1346 |
$blocks, $ldate, $tod ) = split(/\s+/, $_); |
| 1347 |
return( join('.', ($fname, $ftype, $fdisk)), |
1347 |
return( join('.', ($fname, $ftype, $fdisk)), |
| 1348 |
$lrecl * $recs, &main'lstime_to_time( "$ldate $tod" ), |
1348 |
$lrecl * $recs, &main::lstime_to_time( "$ldate $tod" ), |
| 1349 |
'f' ); |
1349 |
'f' ); |
| 1350 |
} |
1350 |
} |
| 1351 |
alarm( 0 ); |
1351 |
alarm( 0 ); |