El lun, 28-02-2005 a las 14:49 +0300, Vladimir D Belousov escribió:
> 1)
>    if (-d $DIR_NAME) {
>       .... directory exists
>     };
> 
> 2)
>   if((lstat($DIR_NAME))[1] & 0040000) {
>      .... directory exists and it is the real directory (not the 
> symbolic link)
>   }else{
>      ... No such directory or it is symbolic link
>   };
> 
> Carlos Mantero wrote:
> 
> >Hi all,
> >
> >I'm a begginer in Perl and other programming languages. I want to verify
> >that a directory exists, but I don't know the way tho do it.
> >
> >Regards.

Hi, I tested the code in my little script but the "if" bucle with the
verify of the directory don't work fine, always print 1.

if ("-d /home/user") {
        print"1\n";
}
else {
        print"2\n";
        exit;
}

I'm desperate because I don't know what is the problem...

Thanks.
-- 
Carlos Mantero <mantero($)gmail.com> <http://www.mantero.tk>

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente

Reply via email to