Thanks for this great lesson, I will take account for this on my furture =))
- Original Message -
From: <[EMAIL PROTECTED]>
To: "LI NGOK LAM" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 12:17 AM
Subject:
On Thu, 24 Jul 2003 23:20:20 +0800, "LI NGOK LAM" <[EMAIL PROTECTED]> wrote:
> 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
On Thu, 24 Jul 2003, LI NGOK LAM wrote:
> if ( -d $path ) { print "Directory" }
> elsif ( -f $path ) { print "File" }
> else { print "Not exist" }
>
> HTH
Cheers all. Think I was trying to be to clever for my own good
RGds
]Rus
--
www: http://jvds.com | Virtual Servers from just $15/mo
MSNM:
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"
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 'pla
> Hi All,
> Just trying to work out the code to test if a path is a
> directory or file. Looked over the stat function but doesn't
> quite seem right. Can someone give me a clue
>
Sure thing:
if(-d $path) { print "$path is adirectory"; }
perldoc -f -d to find out more about file tests
HTH
Dm
-d $dir #if true than is a dir
-f $file #if true than is a regulare file
> -Original Message-
> From: Rus Foster [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 24, 2003 8:39 AM
> To: [EMAIL PROTECTED]
> Subject: Checking for a directory
>
>
> Hi All,
>
if ( -d $path ) { print "Directory" }
elsif ( -f $path ) { print "File" }
else { print "Not exist" }
HTH
- Original Message -
From: "Rus Foster" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 24, 2003 8:39 PM
Subject
file
-T $a Text File True if file named in $a is a text file
so:
if (-d $filename) {
print "'$filename$ is a directory\n";
}
-Original Message-
From: Rus Foster [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 2:39 PM
To: [EMAIL PROTECTED]
Subject:
Hi All,
Just trying to work out the code to test if a path is a directory or file.
Looked over the stat function but doesn't quite seem right. Can someone
give me a clue
thanks
Rus
--
www: http://jvds.com | Virtual Servers from just $15/mo
MSNM: [EMAIL PROTECTED] | Totally Customizable Techno
10 matches
Mail list logo