"John D. Leonard II" wrote:
> 
> All:
> 
> Any code for testing to see if a file exists along the Includes (and
> global) path?
> 
> $Response->Include( $filename)  and  $Response->TrapInclude( $filename )
> automatically scan the path, but return an error if the file is not
> found.  I want to trap this error.
> 
> Is the solution $Server->MapPath, or perhaps to expose SearchDirs
> (inside ASP.pm)?  How about something like:
> 
> $Server->FileExists( $file_to_include_before_it_is_included );
> 

Exposing Apache::ASP::SearchDirs functionality is the answer.  In 2.31,
this will be as:

  my $file_path = $Server->MapInclude($include);

It seems a similar idea to MapPath, but MapPath deals with more how
the web server would translate a URI, while MapInclude() is about how
Apache::ASP would translate an include execution.

Let me know if you would like an early release of the module.  I'll
probably release it soon anyway.  BTW, to deal with this problem
before, I have explicitly trapped errors like:

  eval { $Response->Include() }
  if($@) { # deal with missing include } 

since a missing include will trigger a die().

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

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

Reply via email to