Re: Can you get asleep and be awakened?



On Wednesday 24 December 2003 10:27 am, Stuart Gilbert wrote:
I thought cron jobs were supposed to be used to achieve tasks at certain
times, presuming the tasks you're talking about are external programs,
not something within the program. This is the case here, yes?

I'm not sure...

Suppose the user schedules a file deletion to be executed at 10 pm. 

at 10 pm, my program must do this:

if the files are still there
    delete the files
    UPDATE THE INTERNAL DATABASE
    write an entry to the log window
else
    write error message to log window

How can I use cron for that?

Furthermore, I must have a "tasks" window where the user can cancel a 
scheduled task. So the app must know which tasks have been executed by cron 
and which haven't.

Currently I was thinking of adding another process (or thread) that sleeps 
until a timer rings. Maybe SDL has such timers. But doing a multiprocess 
application in prolog is something I'd like to avoid. So I was hoping GTK 
offered such a thing (awaken you at a precise time).

Thanks for the appreciation!

Maurizio




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]