in reply to Re: Notification of a new file added to directory
in thread Notification of a new file added to directory

It still returns a "1" on my directory even if files are older than a day. Is there something I am doing wrong here???
#!/usr/local/bin/perl use strict; my $mydir = "/mypath/directory"; my $new_one = 0; opendir(DIR, $mydir) or die("..."); while (my $file = readdir(DIR)) { if (-M $mydir . '/' . $file < 0.5) { $new_one = 1; last; } } closedir(DIR); print "$new_one\n";

Replies are listed 'Best First'.
Re: Re: Re: NOtification of a new file added to directory
by gjb (Vicar) on Jan 03, 2003 at 16:34 UTC

    I updated the code again, see if this helps.

    Incidently, why not register, it's much easier to notify you of a change using the chatterbox rather than having to post these otherwise useless notes.

    Hope it works for you this time, -gjb-