Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'd like to check a directory for files, then wait for a period of time, then check the directory again and compare the first count to the second count. That sounds like you want to use dnotify or the newer inotify, or some very similar notification mechanism if you are not using Linux (kqueue on the *BSDs, FSEvents on MacOS X). This avoids inefficient polling in userspace, the kernel will wake up your program whenever something changed that you wanted to be notified of (e.g. create or remove files). Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-) In reply to Re: glob directory to array, then wait, and check again
by afoken
|
|