Alban Nona wrote:
Hello,
Im stuck with this problem: I would like to os.stat st_mtime to copy only the files that have different modification date.
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[1] == 'update':
        if os.stat(localPath).st_mtime != os.stat(networkPath).st_mtime:
os.system('xcopy /E /I /Q /Y "%s" "%s"' % (networkPath, localPath))
        else:
            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 files. 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 info ?
If there a way to do it for every file ?
os.stat doesn't compare anything, it just returns info about a single
file or directory.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to