Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Answer: filtering hidden files on Win32

by anonymized user 468275 (Curate)
on Jan 14, 2016 at 13:36 UTC ( #1152758=note: print w/replies, xml ) Need Help??


in reply to Re: filtering hidden files on Win32
in thread filtering hidden files on Win32

When writing a fire-and-forget duplicates finder just now, I found this thread very useful. My coding style and approach seems rather different though. But whether low code granularity is good is often a highly debated issue.
sub dfind { my ($dref, $top) = @_; hidden( $top ) and return; if (-d $top) { for my $file (glob( "$top/*" )) { dfind( $dref, $file ); } } else { register( $dref, $top ); # add to HoA } } sub hidden { my $file = shift; my $attribs; Win32::File::GetAttributes($file, $attribs); return $attribs & HIDDEN; }
Update: note that hidden directories and files are both filtered out owing to how the recursion is contructed.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1152758]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2021-06-13 11:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (54 votes). Check out past polls.

    Notices?