- return $size; # near zero, or negative
-} #}}}
-
-package IkiWiki::PageSpec;
-
-sub match_maxsize ($$;@) { #{{{
- shift;
- my $maxsize=eval{IkiWiki::Plugin::attachment::parsesize(shift)};
- if ($@) {
- return IkiWiki::FailReason->new("unable to parse maxsize (or number too large)");
- }
-
- my %params=@_;
- if (! exists $params{file}) {
- return IkiWiki::FailReason->new("no file specified");
- }
-
- if (-s $params{file} > $maxsize) {
- return IkiWiki::FailReason->new("file too large");
- }
- else {
- return IkiWiki::SuccessReason->new("file not too large");
- }
-} #}}}
-
-sub match_minsize ($$;@) { #{{{
- shift;
- my $minsize=eval{IkiWiki::Plugin::attachment::parsesize(shift)};
- if ($@) {
- return IkiWiki::FailReason->new("unable to parse minsize (or number too large)");
- }
-
- my %params=@_;
- if (! exists $params{file}) {
- return IkiWiki::FailReason->new("no file specified");
- }
-
- if (-s $params{file} < $minsize) {
- return IkiWiki::FailReason->new("file too small");
- }
- else {
- return IkiWiki::SuccessReason->new("file not too small");
- }
-} #}}}
-
-sub match_ispage ($$;@) { #{{{
- my $filename=shift;