in reply to Re: Re: Testing for existance of subdirectories
in thread Testing for existance of subdirectories

I would change that test to:

if ($attrib & 16) { return 1 }

What you're doing is testing bit 4 of the file attributes, which is probably the "directory" bit. But if this was a read-only, hidden, etc directory, that $attrib would be something else, like 17.

If that doesn't make sense, here's a hint; ask if this isn't too clear:

You want to test this bit v 16 = 00010000b 17 = 00010001b ^

Replies are listed 'Best First'.
Re: Re: Re: Re: Testing for existance of subdirectories
by ChrisNutting (Initiate) on Aug 19, 2001 at 15:06 UTC
    THANK YOU!!! (You read my mind!) I just scanned my D:\ which has lots of dir's with the system bit set, and it wasn't scanning properly the depth properly. (It's working perfectly now :) (Scanned c:\windows testing every sub for subs, in 4secs)
                        ("`-''-/").___..--''"`-._
                         `6_ 6  )   `-.  (     ).`-.__.`)
                         (_Y_.)'  ._   )  `._ `. ``-..-'
                       _..`--'_..-_/  /--'_..' ,'
                     (il),-''  (li),'  ((!.-'