hi guys...

  I tried using the -T and -B file tests against $r->finfo and found they
didn't work.  I'm guessing this is because -T and -B are special perl tests
that have to read in the file, and that Apache's stat() doesn't glean this
information on its own.

  so, is this a bug or a feature? :) from the looks of the mod_perl stuff, I
guess we would have to call our own stat() to get at it, which kinda defeats
the purpose.  maybe it's possible to run through only the -T stuff instead
of a full stat using some XS wizardry?

  anyway, another thing to consider for 2.0 :)

--Geoff

package Stat;

use Apache::Constants qw(OK);
use strict;

sub handler {
  my $r = shift;
  $r->send_http_header('text/plain');
  if (-f $r->finfo) {
  print "file ", $r->filename, " exists\n",
        "and must be either plain or binary...\n";
  print "it's binary" if -B $r->finfo;
  print "it's text" if -T $r->finfo;
  } else {
    print "no file... sorry";
  }
  return OK;
}
1;

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to