| Author |
to verify if the file is refreshing
|
|
| pawan_test 2007-02-28, 4:07 am |
| Hi All,
I have a text file. before processing the file i have to verify of the
file is refreshing .
if the file is not refresing then i have to process it.
can you please let me know how do i check if the file is refreshing .
Thanks
mark
| |
| Ian Collins 2007-02-28, 4:07 am |
| pawan_test wrote:
> Hi All,
>
> I have a text file. before processing the file i have to verify of the
> file is refreshing .
> if the file is not refresing then i have to process it.
>
> can you please let me know how do i check if the file is refreshing .
>
How do you define 'refreshing'?
Do you control both the reader and the writer to the file? If so, you
could use flock().
--
Ian Collins.
| |
| Beej Jorgensen 2007-02-28, 4:07 am |
| Ian Collins <ian-news@hotmail.com> wrote:
>pawan_test wrote:
>How do you define 'refreshing'?
Cool. Crisp. Clear.
Ahhh, that's a refreshing file.
-Beej
| |
| Jens Thoms Toerring 2007-02-28, 4:07 am |
| pawan_test <sridhara007@gmail.com> wrote:
> I have a text file. before processing the file i have to verify of the
> file is refreshing .
> if the file is not refresing then i have to process it.
> can you please let me know how do i check if the file is refreshing .
If "is refreshing" got something to do with the date of the last
modification of the file take a look at the stat(2) function, it
fills in a structure that has a member called 'st_mtime' which is
the date of the last modification of the file. Hopefully you don't
need a resolution of higher than 1 second.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
|
|
|
|