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: Checking for a directory


> 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 Technology
> e: [EMAIL PROTECTED]       | FreeBSD & Linux
>        10% donation to FreeBSD.org on each purchase
>
> -- 
> 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]

Reply via email to