It seems to me that if you want the five most recent changes, you don't have to keep a list of modified dates. Just get the modified date for all the files of interest and sort by date, then pick the top five.

You could do this as part of your process to build the web site maybe?

Kent

Jay Loden wrote:
I have a sort of simple CMS system on my website made from a conglomeration of scripts. On the left column, I want to add a feature that shows the last five items updated (only html & exe files in the /var/www/html/ for example) directory that I have updated, with each item as a link to the page. You can see what this is supposed to look like at http://jayloden.com (right now it's being done by hand)

I've been thinking of having a crontab run a Python script, which logs checks a file with something along the lines of:

file.foo = 12:20-1/20/05

for each file, containing the date and time the file was last modified. Then I would have the crontab script check the date in the file versus the dates on the current files, and if the current files have been updated, to add them to the html on the side of the page. I have no trouble setting up the crontab, or editing the html template for my page (it's all created from php on the fly) but I wanted to know if I am going about this a semi-intelligent and/or efficient way, or if there is some incredibly better way that I could do this with Python. For example, is there some other way to notify my script that a file has been modified, rather than run a crontab a couple times an hour. Is there maybe a better way to store and check dates, etc.

Thanks!
-Jay
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Reply via email to