py script modify it's Modified Time?

E

est

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)
 
K

kyosohma

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
 
G

Gabriel Genellina

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

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

est

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:

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/

Thanks guys ,you are of great healp!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top