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

Re: [MacPerl] -d and hidden icon files



At 17:10 10/12/96, Richard Rathe wrote:
>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?

It seems like a bug, but it's understandable how it happens.  The name of
the hidden file is
   "Icon\0x0D"
(that is, Icon<real ASCII CR>).

It is easy to imagine code which would divide that into "Icon" and "".

   --John

  --
   Development of software takes longer and costs more.
jwbaxter@olympus.net (John W. Baxter)  Port Ludlow, WA, USA