[Tutor] reading file creation date and xreadlines from a pointin the middle of a file
Tue, 5 Feb 2002 10:49:29 -0600
Your class looks promising, Im going to experiment w/ it for a while.
----- Original Message -----
From: "Danny Yoo" <firstname.lastname@example.org>
To: "Jim Ragsdale" <email@example.com>
Cc: "Python Tutor Mailing List" <firstname.lastname@example.org>
Sent: Monday, February 04, 2002 8:37 PM
Subject: Re: [Tutor] reading file creation date and xreadlines from a
pointin the middle of a file
> On Mon, 4 Feb 2002, Jim Ragsdale wrote:
> > I have looked around and have not found a way (that I could
> > understand) to read the creation date of a file. Does anyone know how
> > to do it? Not necessary but cross platform would be nice. win32 is the
> > target.
> There are actually two functions in os.path called getatime() and
> getmtime, respectively for "access" and "modification" times:
> os.path.getmtime() is probably what you're looking for:
> >>> os.path.getmtime('/var/mail/dyoo')
> >>> from time import localtime
> >>> localtime(os.path.getmtime('/var/mail/dyoo'))
> (2002, 2, 4, 17, 49, 10, 0, 35, 0)
> I'm not sure if the system maintains a "creation" time flag, as it's sorta
> arguable that modification is similar to creation. Perhaps someone else
> may be able to find out about this?
> > Another question: I am using xreadlines. How do I start reading at a
> > specified line in a file?
> xreadlines() might not be an appropriate function because it assumes you
> want to read through the file sequentially, one line at a time. If we
> suck up the whole file as a list of lines by using readlines(), we can
> grab any line by doing an array index, so readlines() is probably a better
> I've written a quicky RandomFile class that I think might be more
> memory-efficient if you're concerned about memory usage:
> Good luck to you!
> Tutor maillist - Tutor@python.org