Compare 2 times

garabik-news-2005-05 at garabik-news-2005-05 at
Sun Jun 10 08:31:02 CEST 2012

t_texas <tyevans at> wrote:
> On Jun 6, 7:50 am, loial <jldunn2... at> wrote:
>> I have a requirement to test the creation time of a file with the
>> current time and raise a message if the file is  more than 15 minutes
>> old.
>> Platform is Unix.
>> I have looked at using os.path.getctime for the file creation time and
>> time.time() for the current time, but is this the best approach?
> Unless you are using ext4 you are going to have to store the creation
> time yourself.  If the files are coming from your application, use the
> sqlite3 or shelve module to store the creation time for each file then
> check that data to determine which files are more than 15 minutes old.

pyinotify might be worth a look

| Radovan Garabík |
| __..--^^^--..__    garabik @     |
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!

More information about the Python-list mailing list