os.stat st_mtime problem
python.koda at gmail.com
Mon Aug 16 19:42:22 CEST 2010
Im stuck with this problem:
I would like to os.stat st_mtime to copy only the files that have different
so I found something on internet using this kind of line:
if os.stat(dest).st_mtime - os.stat(src).st_mtime > 1:
shutil.copy2 (src, dst)
So I adapted it to my script like that:
if sys.argv == 'update':
if os.stat(localPath).st_mtime != os.stat(networkPath).st_mtime:
os.system('xcopy /E /I /Q /Y "%s" "%s"' % (networkPath,
print "Everything match"
localPath is equal to : "c:\test\prod\"
and networkPath to : "d:\test\prod\"
the content of this paths is another directory: "v001", where there some tga
Now I dont even know if os.stat compare the modified version of every files
contained in localPath and networkPath, or does it compare only the v001
If there a way to do it for every file ?
Thank you !
(PS: I want to avoid filecmp :p)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list