in reply to Retrive Hidden files

This may help:
#!/usr/bin/perl use strict; use warnings; use Win32::File; my $file = 'some.file'; my $attr; Win32::File::GetAttributes($file, $attr); if ($attr & (Win32::File::HIDDEN)){ print "$file is hidden\n"; } else{ print "$file not hidden\n"; }

Replies are listed 'Best First'.
Re^2: Retrive Hidden files
by bart (Canon) on Jun 04, 2005 at 11:14 UTC
    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.

      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