Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Get the date of last modification of a file

Reply
Thread Tools

Get the date of last modification of a file

 
 
Manuel Bastioni
Guest
Posts: n/a
 
      09-08-2003
It's possible using only a built-in module?

Thx,

Manuel


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 01/09/2003


 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?Gerhard_H=E4ring?=
Guest
Posts: n/a
 
      09-08-2003
Manuel Bastioni wrote:
> It's possible using only a built-in module?


Sure:

>>> import os, stat
>>> s = os.stat("c:/tmp")
>>> time.strftime("%Y-%m-%d %H:%M", time.localtime(s.st_mtime))

'2003-09-08 19:17'

> Outgoing mail is certified Virus Free.


What a stupid thing to say.

-- Gerhard

 
Reply With Quote
 
 
 
 
Peter Hansen
Guest
Posts: n/a
 
      09-08-2003
Manuel Bastioni wrote:
>
> It's possible using only a built-in module?


os.path.getmtime()
 
Reply With Quote
 
Manuel Bastioni
Guest
Posts: n/a
 
      09-09-2003

> > It's possible using only a built-in module?

>
> os.path.getmtime()

....

>>> import os, stat
>>> s = os.stat("c:/tmp")


os isn't built-in
Thx,

Manuel



 
Reply With Quote
 
Erik Max Francis
Guest
Posts: n/a
 
      09-09-2003
Manuel Bastioni wrote:

> os isn't built-in


In that case, I think the relevant question is why you think you need a
builtin function rather than a standard library function.

--
Erik Max Francis && && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ To be refutable is not the least charm of a theory.
\__/ Friedrich Nietzsche
 
Reply With Quote
 
Peter Hansen
Guest
Posts: n/a
 
      09-09-2003
Manuel Bastioni wrote:
>
> > > It's possible using only a built-in module?

> >
> > os.path.getmtime()

> ...
>
> >>> import os, stat
> >>> s = os.stat("c:/tmp")

>
> os isn't built-in


The question was strange, since requiring a true builtin for
this is pointless, so I interpreted the question as though
you were a newbie who didn't use the term "built-in" to mean
what it usually means in Python. I figured you just wanted
to use a module that came with standard Python instead of
requiring a separate download.

So since you've clarified that, I'll be interested to see the
answer to Erik Max Francis' question, too.

-Peter
 
Reply With Quote
 
Manuel Bastioni
Guest
Posts: n/a
 
      09-09-2003

> The question was strange, since requiring a true builtin for
> this is pointless, so I interpreted the question as though
> you were a newbie who didn't use the term "built-in" to mean
> what it usually means in Python. I figured you just wanted
> to use a module that came with standard Python instead of
> requiring a separate download.
>
> So since you've clarified that, I'll be interested to see the
> answer to Erik Max Francis' question, too.



I want use only built-in module because
I'm writing a python scripts from Blender.
To have all standard libs, the Blender user
(often not developer) must install the full python
distribution, and after must set the python path
in Blender.
http://www.elysiun.com/forum/viewtopic.php?t=7723

To semplify this, I want use only the
built-in function, directly in Blender interpreter.

You can see my script here:
http://www.dedalo-3d.com/makehuman.html
http://www.dedalo-3d.com/disp_en.html

Thanks,

Manuel


PS for Gerhard:
>What a stupid thing to say.

This is only an automatic message from my antivirus.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Last "real" modification date of file Bart Van der Donck Perl Misc 3 06-18-2008 06:01 PM
File Modification Date Vance M. Allen Perl Misc 6 09-15-2005 06:28 AM
log4j doesn't set file modification date correctly Andy Fish Java 0 07-20-2004 10:20 AM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Action Based on File's Last Modification Time: Is One Approach Better? James E Keenan Perl Misc 1 10-14-2003 02:24 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57