Yep ! =)
Even though I can't imagine what a path is not file or directory would imply
more then not exist. But I agree to check the existence for a path by -e
is the safest operation.
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "LI NGOK LAM" <[EMAIL PROTECTED]>; "Rus Foster" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, July 24, 2003 11:06 PM
Subject: Re: Checking for a directory
>
> ------------------------------------------------
> On Thu, 24 Jul 2003 23:00:17 +0800, "LI NGOK LAM" <[EMAIL PROTECTED]> wrote:
>
> > if ( -d $path ) { print "Directory" }
> > elsif ( -f $path ) { print "File" }
> > else { print "Not exist" }
> >
>
> "Not exist" is misleading, just because a file is not a 'plain' file or a
'directory' does *NOT* indicate non-existence. Existence should be checked
explicitly with the -e operator.
>
> http://danconia.org
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]