in reply to filtering hidden files on Win32
Same basic code... just a few tweaks here and there to get the constant working.
#!perl -w use strict; use Cwd; use Win32::File; my $attribs; my $dir = cwd(); print $dir,$/; opendir( DIR, $dir ) or die "Couldn't open $main::DIR: $!\n"; my @vis_files = grep { -f $dir.'/'.$_ and Win32::File::GetAttributes($_, $attribs) and !($attribs & HIDDEN) } readdir(DIR); closedir( DIR ) or warn "Couldn't close $main::DIR: $!\n"; print $_, $/ for @vis_files;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: filtering hidden files on Win32
by anonymized user 468275 (Curate) on Jan 14, 2016 at 13:36 UTC |