in reply to Find the Files added to the directory in Linux.
There is more than one way to skin this cat. Here is one way using the Linux inotify facility
See Linux::Inotify for details
use strict; use warnings; use Linux::Inotify; my $notifier = Linux::Inotify->new(); my $watch = $notifier->add_watch('/directory/to/monitor', Linux::Inoti +fy::CREATE); while (1) { for my $event ($notifier->read()) { print "New file named: " . $event->fullname() . "\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Find the Files added to the directory in Linux.
by flexvault (Monsignor) on Jul 05, 2013 at 11:22 UTC | |
by Loops (Curate) on Jul 05, 2013 at 11:26 UTC | |
by flexvault (Monsignor) on Jul 05, 2013 at 11:34 UTC | |
by Loops (Curate) on Jul 05, 2013 at 11:38 UTC |