FAQ
I'm a real beginner.
I made a little program to copy files to an other folder (see below)

# Remote resetten van ColdFusion server

$interval=5;
while (l) {
sleep ($interval - time() % $interval );
if (-r 'c:\reset\spool\cfreset.bat') {
print ("Bestand cfreset.bat gevonden\n");
system('c:\reset\spool\cfreset.bat');
unlink('c:\reset\spool\cfreset.bat');
# ($Second, $Minute, $Hour, $DayOfMonth, $Month, Year,
# $Weekday, $DayOfYear, $IsDST) = localtime(time);
# $RealMonth = $Month + 1;
# Print "$RealMonth/$DayOfMonth/$Year";
}

}


I'm trying to see after each copy action the time...........
Maybe to easy for you but i can't get the right code.

Thanx!

Search Discussions

  • Andrea Holstein at Dec 13, 2001 at 1:43 pm

    Klaas schrieb:
    I'm a real beginner.
    I made a little program to copy files to an other folder (see below)

    # Remote resetten van ColdFusion server

    $interval=5;
    while (l) {
    sleep ($interval - time() % $interval );
    if (-r 'c:\reset\spool\cfreset.bat') {
    print ("Bestand cfreset.bat gevonden\n");
    system('c:\reset\spool\cfreset.bat');
    unlink('c:\reset\spool\cfreset.bat');
    # ($Second, $Minute, $Hour, $DayOfMonth, $Month, Year,
    # $Weekday, $DayOfYear, $IsDST) = localtime(time);
    # $RealMonth = $Month + 1;
    # Print "$RealMonth/$DayOfMonth/$Year";
    }

    }


    I'm trying to see after each copy action the time...........
    Maybe to easy for you but i can't get the right code.
    I'm not sure, whether I can help you to solve your problem.
    But I can help you to write it in a more perlish way:

    First question: Why changes the sleep interval.
    Is an interval of 5 seconds not enough ?! I will assume that it is:

    $_ = 'c:\reset\spool\cfreset.bat';
    while ("No ones press ^C") {
    sleep 5;
    next unless -r;
    print "Bestand cfreset.bat gevonden\n";
    system;
    unlink;
    ($day_of_month, $month, $year) = localtime(time())[3..5];
    $month++;
    print "$month/$day_of_month/$year";
    }

    Reads better, doesn't it ?!


    Best Wishes,
    Andrea

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedDec 12, '01 at 1:21p
activeDec 13, '01 at 1:43p
posts2
users2
websiteperl.org

2 users in discussion

Klaas: 1 post Andrea Holstein: 1 post

People

Translate

site design / logo © 2022 Grokbase