# note that loading File::Spec earlier almost certainly made this a no-op
# regex matching an acceptable filename in "this" directory
-# must begin with alphanumeric, underscore, or plus sign
-# and contain only those characters, plus hyphen, dot, and tilde
+# must begin with an alphanumeric character
+# and contain only alphanumeric, underscore, plus sign, hyphen, dot, and tilde
# note that an acceptable filename may not begin with dot, so ".." is out
-my $RE_filename_here = qr/[[:alnum:]_+][-.[:alnum:]_+~]*/;
+my $RE_filename_here = qr/[[:alnum:]][-.[:alnum:]_+~]*/;
# regex matching an acceptable relative filename in POSIX syntax
# all components must be acceptable filenames
# empty components are not allowed
age_file [file join $tenv incoming bogus3] "1 minute ago"
foreach file {
- _bogus +bogus __bogus _+bogus _-bogus _~bogus _.bogus
+ bo_gus bo+gus bo-gus bo~gus bo.gus
} {
put_file [file join $tenv incoming ${file}] "bogus file $file\n"
age_file [file join $tenv incoming ${file}] "3 minutes ago"
# files which are to be rejected, ignored, and removed
foreach file {
- x=x .abcfoobar -abcfoobar x;x \\~xax x*x x:x x?x ;xax
+ x=x .abcfoobar -abcfoobar x;x \\~xax x*x x:x x?x ;xax _x +x
} {
put_file [file join $tenv incoming ${file}] "bogus input $file\n"
age_file [file join $tenv incoming ${file}] "3 minutes ago"
incoming
} files {
bogus1 bogus2 bogus3
- _bogus +bogus __bogus _+bogus _-bogus _~bogus _.bogus
+ bo_gus bo+gus bo-gus bo~gus bo.gus
}
analyze_file_tree $tenv "idle processing: bogus files" {
in-stage stage pub archive
recent,bogus3 "skipped recent file: bogus3"
- scan,_bogus "scan found file: _bogus"
- scan,+bogus "scan found file: +bogus"
- scan,__bogus "scan found file: __bogus"
- scan,_+bogus "scan found file: _+bogus"
- scan,_-bogus "scan found file: _-bogus"
- scan,_~bogus "scan found file: _~bogus"
- scan,_.bogus "scan found file: _.bogus"
+ scan,bo_gus "scan found file: bo_gus"
+ scan,bo+gus "scan found file: bo+gus"
+ scan,bo-gus "scan found file: bo-gus"
+ scan,bo~gus "scan found file: bo~gus"
+ scan,bo.gus "scan found file: bo.gus"
!scan,x=x "ignored file: x=x"
!scan,.abcfoobar "ignored file: .abcfoobar"
!scan,x:x "ignored file: x:x "
!scan,x?x "ignored file: x?x"
!scan,;xax "ignored file: ;xax"
+ !scan,_x "ignored file: _x"
+ !scan,+x "ignored file: +x"
}
analyze_no_mail $tenv "idle processing: bogus files"