Thanks Charles,
You are correct - I won't be moving directories often, so I have
incorporated your 'existence subroutine' suggestion into my perl program
with absolute pathnames. It is now much tidier.
Thanks again guys,
Mike.
----- Original Message -----
From: "Charles K. Clarkson" <[EMAIL PROTECTED]>
To: "'Mike'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, September 07, 2003 1:54 AM
Subject: RE: File existence under Microsoft IIS
> Mike <[EMAIL PROTECTED]> wrote:
>
> : To elaborate, I had to set 2 path variables. One to
> : define the absolute path of the uploaded image files on
> : the web server, and the other to define the relative
> : path (from the perl program) to the image files.
>
> There is no need to use relative paths from the perl
> program. You can use absolute paths for the whole site
> unless you move directories often. Define a subroutine
> which adds the file system root to the absolute path
> from the web root.
>
> For example:
>
> C:\example\home\ is web root on file system
> /images/ is the image directory
> /code/perl/ is where the perl code resides
>
> A relative path might look like "../../image/file.png"
> The absolute path would be: "/image/file.png"
>
> In code you could write a sub routine for
> existence:
>
> sub exists {
> return -e "C:/example/home$_[0]";
> }
>
> Feed it an absolute path from the web root:
>
> $filename = '/images/file.jpg';
>
> if ( exists( $filename ) ) {
> #
> # Do something with $filename
> #
> }
>
> HTH,
>
> Charles K. Clarkson
> --
> Head Bottle Washer,
> Clarkson Energy Homes, Inc.
> Mobile Home Specialists
> 254 968-8328
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]