in reply to The "readdir()" fails to detect files created after the call to "opendir()"

More kind of a meta mediation:

Actually this (non-)behavior is consistent with most other iterators on Perl.

For instance modifying a foreach @array is discouraged and modifying a %hash would reset each . A normal filehandle is controlled by tell and seek (IIRC).

So the default is to consider the iterated data as immutable.

There is no generally accepted way to handle other case except leaving it to the programmer to work around it with extra constructs.

Besides how should "a new file" be defined? Another name? Another inode? Other content? Changed timestamp?

YMMV!

Cheers Rolf

PS: Je suis Charlie!

  • Comment on Re: The "readdir()" fails to detect files created after the call to "opendir()" (iterators)
  • Select or Download Code