Get the date of last modification of a file

Discussion in 'Python' started by Manuel Bastioni, Sep 8, 2003.

  1. 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
     
    Manuel Bastioni, Sep 8, 2003
    #1
    1. Advertising

  2. 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
     
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=, Sep 8, 2003
    #2
    1. Advertising

  3. Manuel Bastioni

    Peter Hansen Guest

    Manuel Bastioni wrote:
    >
    > It's possible using only a built-in module?


    os.path.getmtime()
     
    Peter Hansen, Sep 8, 2003
    #3

  4. > > 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
     
    Manuel Bastioni, Sep 9, 2003
    #4
  5. 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
     
    Erik Max Francis, Sep 9, 2003
    #5
  6. Manuel Bastioni

    Peter Hansen Guest

    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
     
    Peter Hansen, Sep 9, 2003
    #6

  7. > 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.
     
    Manuel Bastioni, Sep 9, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,300
    Michael Borgwardt
    May 30, 2004
  2. Andy Fish
    Replies:
    0
    Views:
    629
    Andy Fish
    Jul 20, 2004
  3. James E Keenan
    Replies:
    1
    Views:
    128
    Steve Grazzini
    Oct 14, 2003
  4. Vance M. Allen

    File Modification Date

    Vance M. Allen, Sep 14, 2005, in forum: Perl Misc
    Replies:
    6
    Views:
    150
    Josef Moellers
    Sep 15, 2005
  5. Bart Van der Donck

    Last "real" modification date of file

    Bart Van der Donck, Jun 18, 2008, in forum: Perl Misc
    Replies:
    3
    Views:
    174
    Bart Van der Donck
    Jun 18, 2008
Loading...

Share This Page