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
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]