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

Re: [MacPerl] recursive dir script



jim.easterbrook@rd.bbc.co.uk (Jim Easterbrook) writes:
>Gilbert Rankin <gilbert@netcom.com> wrote:
>
>>I don't think that it is.  It is possible to use a disk editor to rename a
>>file to ascii NULL, 0x00, and the file will appear to have no name.  Maybe
>>that's what has been done to the file you encountered.  If so I wonder
>>why...
>
>I found a similar file in my clip2gif folder. I reinstalled from the
>distributed .sit file and it reappeared. This also fooled my recursive
>directory searching script. I copied what appeared in the MacPerl output
>window as a string of colons ("::::") to a BBEdit window with a different
>font, which revealed it to be a string of colons separated by NULLs
>(":%:%:%:", where % is a little NU character).

This looks like a serious problem, and one that isn't easy to fix. Basically,
a reliance on NUL-terminated C strings is deeply ingrained in Perl, and it's
almost impossible to excise. I cannot promise a remedy before I get a
direct File manager interface ready.

A quick fix, which at least avoid crashes, is to test the reslt of a readdir
for zero length.

Matthias

-----
Matthias Neeracher <neeri@iis.ee.ethz.ch> http://err.ethz.ch/members/neeri.html
  "And that's why I am going to turn this world upside down, and make
   of it a fire so *bright* that someone real will notice"
                                -- Vernor Vinge, _Tatja Grimm's World_