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

Re: Refreshing stored data at administrator's signal


On Jan 13, 2008 4:19 PM, Colin Wetherbee <suppressed> wrote:
> I thought about the file thing... if the file exists, check its last
> modified timestamp; if that timestamp is greater than the stored
> timestamp, then update the data from the database.  It seems like
> unnecessary disk access, though.  Then again, this whole problem is
> riddled with unnecessary disk access. :)

Using a "touch file" is the classic solution to this problem.  You
check the mod time on a file (it's okay for it always be there -- it's
just the mod time we care about) and compare that to the last update
time that you keep in a global.  It's dirt simple, avoids messy
problems with signals, and it should end up in your operating system's
disk cache so it really won't do any physical disk reads.

- Perrin


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.