Results 1 to 5 of 5
Hello
I am trying to write an app in which after a file is created, it must be moved out in 10 mins. ie if after 10 mins I find ...
- 02-21-2008 #1Just Joined!
- Join Date
- Jan 2008
- Posts
- 22
Timers in C
Hello
I am trying to write an app in which after a file is created, it must be moved out in 10 mins. ie if after 10 mins I find the file still open and present then I do something.
My problem is in being able to measure these 10 mins . Is there any sort of a timer in C, such that I can start it when I create the file and stop/reset it when I move it. If it reaches 10 mins then I go to the handler and write some code to handle it.
Ie i need some timer event in C.
thanks
- 02-21-2008 #2
Not really sure what you want to do but you could try alarm();
- 02-21-2008 #3Just Joined!
- Join Date
- Jan 2008
- Posts
- 22
alarm only works on single threads.
I have a single threaded app and I have multiple files that I open at different times, every 5 mins I move the files to another directory and create another new one in its place.
So If I see that a file has been here for more than 10 mins I want to handle it differently.
- 02-21-2008 #4
Try the stat() function it will give you all kinds of file info like creation time
- 02-22-2008 #5Just Joined!
- Join Date
- Jan 2008
- Posts
- 22
I know, but how do I do this every 10 mins ?


Reply With Quote