[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] -d and hidden icon files



I have a program that recursively climbs the directory tree looking for
index.html files on our server. Everything worked well in a test situation,
but when I moved it to the server it went off into never never land. I
finally isolated the problem to a certain directory with a custom folder
icon. The ICON itself is stored as a hidden file in the folder. The code
below seems to treat this file as a directory (-d) with an empty name?!?!

  foreach $item (@list) {
    if ($item =~ /^index\.html/i) {
      &read_file($dir,$item);
    } elsif (-d $dir . ':' . $item) {
      &climb_dir($dir . ':' . $item);
    }
  }

Adding a check for the empty name fixed the problem.

    } elsif ($item && -d $dir . ':' . $item) {

So... my questions are a) Is this a bug? or b) Am I abusing -d in some way?

Thanks, RR

__________________________________________________________________________
  Richard Rathe, MD                              rrathe@dean.med.ufl.edu
  University of Florida                  http://www.med.ufl.edu/medinfo/