That depends on your shells. At least under bash, you can use glob() to grab dot files, for example:
print "$_\n" for grep{ -f } glob(".*");
Or probably if you want to grab both dot and non-dot files:
print "$_\n" for grep{ -f } glob("{*,}.*");
Regards,
Xicheng
| [reply] |
Nope. It does not depend on your shell. At least not if you're using Perl 5.6 or later, because glob is implemented via the standard File::Glob extension and does not rely on shell anymore.
The standard behavior of <*> or glob('*') is to not consider the dot files.
| [reply] [d/l] [select] |
In the example given, glob is not used with '*'.
| [reply] |
is it efficient with more than 100 000 files in the directory ?
if I well understand the code, each inode is loaded in memory... so do you know another mean to get this count, without need of a huge memory ? | [reply] |