[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] a file test for hiddenness?



OK, here's a problem I've run into several times:

In the guts of several programs that opendir a directory and then do
various things with the list of all the items in them, I kept finding
out that there were hidden items screwing things up.
To wit: the "Icon\cm" file, and the "Temporary Items" and "Network Trash
Folder" directories.

So in all of these programs I ended up saying:
 @never_see{ # Things I never want to see or try to select
  "Icon\cm",
  "Temporary Items",
  "Network Trash Folder",
 } = ();

and then going:
 @items = grep(!exists($never_see{$_}, readdir(INDIR));
which seems to work fine, but I figure there's gotta be a better way; is
the defining characteristic of these items that they are hidden, or
what?  If so, what file test operator am I to use?

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch