py script modify it's Modified Time?

Discussion in 'Python' started by est, Apr 11, 2007.

  1. est

    est Guest

    I guess os.stat() could retrieve information about ctime, mtime of a
    path, but how can I change them? Is it possible to make it work both
    under Win32 and Linux?

    P.S. How to get the current running python? (Like
    WScript.ScriptFullName in vbscript)
    est, Apr 11, 2007
    #1
    1. Advertising

  2. est

    Guest

    On Apr 11, 6:14 am, "est" <> wrote:
    > I guess os.stat() could retrieve information about ctime, mtime of a
    > path, but how can I change them? Is it possible to make it work both
    > under Win32 and Linux?
    >
    > P.S. How to get the current running python? (Like
    > WScript.ScriptFullName in vbscript)


    I am not sure if you can change a creation time of a file on NT, but
    the rest sounds possible; according to this post anyway:

    http://mail.python.org/pipermail/python-list/2001-August/100214.html

    It mentions using the win32 modules, which can be found here:
    http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/pywin32/win32_modules.html

    As to your last question of finding the current running python, use
    the sys module's "executable" method, like so: sys.executable

    Mike
    , Apr 11, 2007
    #2
    1. Advertising

  3. En Wed, 11 Apr 2007 10:33:57 -0300, <> escribió:

    > On Apr 11, 6:14 am, "est" <> wrote:


    >> I guess os.stat() could retrieve information about ctime, mtime of a
    >> path, but how can I change them? Is it possible to make it work both
    >> under Win32 and Linux?

    >
    > I am not sure if you can change a creation time of a file on NT, but
    > the rest sounds possible; according to this post anyway:
    >
    > http://mail.python.org/pipermail/python-list/2001-August/100214.html


    That post is rather old... With os.utime you can set the access and
    modified time, and it's portable.
    Creation time isn't stored on [the normal filesystems used by] Linux, and
    on Windows you can use win32file.SetFileTime

    > It mentions using the win32 modules, which can be found here:
    > http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/pywin32/win32_modules.html


    Better https://sourceforge.net/projects/pywin32/

    --
    Gabriel Genellina
    Gabriel Genellina, Apr 11, 2007
    #3
  4. est

    est Guest

    On 4ÔÂ12ÈÕ, ÉÏÎç2ʱ26·Ö, "Gabriel Genellina" <> wrote:
    > En Wed, 11 Apr 2007 10:33:57 -0300, <> escribi¨®:
    >
    > > On Apr 11, 6:14 am, "est" <> wrote:
    > >> I guess os.stat() could retrieve information about ctime, mtime of a
    > >> path, but how can I change them? Is it possible to make it work both
    > >> under Win32 and Linux?

    >
    > > I am not sure if you can change a creation time of a file on NT, but
    > > the rest sounds possible; according to this post anyway:

    >
    > >http://mail.python.org/pipermail/python-list/2001-August/100214.html

    >
    > That post is rather old... With os.utime you can set the access and
    > modified time, and it's portable.
    > Creation time isn't stored on [the normal filesystems used by] Linux, and
    > on Windows you can use win32file.SetFileTime
    >
    > > It mentions using the win32 modules, which can be found here:
    > >http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/pywin32/win32_...

    >
    > Betterhttps://sourceforge.net/projects/pywin32/
    >
    > --
    > Gabriel Genellina


    Thanks guys ,you are of great healp!
    est, Apr 12, 2007
    #4
    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. Ajay
    Replies:
    6
    Views:
    416
    Jeremy Bowers
    Sep 28, 2004
  2. flamesrock
    Replies:
    8
    Views:
    438
    Hendrik van Rooyen
    Nov 24, 2006
  3. Replies:
    2
    Views:
    1,092
    Daniel Pitts
    Mar 9, 2007
  4. Raymon Du
    Replies:
    2
    Views:
    380
    Juan T. Llibre
    May 30, 2008
  5. Guest
    Replies:
    2
    Views:
    163
    J. Gleixner
    Oct 1, 2004
Loading...

Share This Page