in reply to Re: File Find permissions check
in thread File Find permissions check

I really only need to check if I have read or write permissions on the directory not execute permissions.

Replies are listed 'Best First'.
Re: Re: Re: File Find permissions check
by ant9000 (Monk) on Jul 07, 2003 at 14:28 UTC
    Pardon me in advance, fellow monks!
    I know it's ugly and just a terrible hack... but, personally, if I have to get the job done and -r is not reliable, I wouldn't mind that much trying
    if(!opendir(DIR,$startDir)){ # ... }else{ closedir(DIR); }

    Finding, installing, testing a module for doing just that seems a bit of an overkill... just my 0.02euros, as usual.
      thanks it now works. Question about adding "exit" command. If I add it in the below area will it be a problem because I am exiting without doing the "closedir(DIR)" filehandle??
      PLease advise if this is okay??
      if(!opendir(DIR,$startDir)){ print "No permission to open directory $startDir\n"; exit 0; }else{ closedir(DIR); }