in reply to Re: Retrive Hidden files
in thread Retrive Hidden files

He means to list the hidden files, such as with readdir or glob. I doubt if these include hidden files, but I doubt it.

Well, if all else fails, it's still possible to get a directory listing with plain API calls (FindFirstFile, FindNextFile, and FileClose) and Win32::API. I'm not sure there's another Win32 specific module that offers a simpler interface.

Replies are listed 'Best First'.
Re^3: Retrive Hidden files
by wfsp (Abbot) on Jun 04, 2005 at 11:32 UTC
    readdir does return hidden files.

    Something like this could identify them:

    #!/usr/bin/perl use strict; use warnings; use Win32::File; my $dir = 'some.dir'; opendir(my $dh, $dir); my @files = readdir $dh; for my $file (@files){ my $attr; Win32::File::GetAttributes($file, $attr); if ($attr & (Win32::File::HIDDEN)){ print "$file is hidden\n"; } else{ print "$file not hidden\n"; } }

    Update:

    activestate 5.8.6 on winXP home