1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| import os import shutil filePath = '/xxx/' newPath = '/yyy/'
os.mkdir(path)
for filename in os.listdir(filePath): t = os.stat(filePath+"/"+filename).st_ctime t2 = os.path.getctime(filePath+"/"+filename) t3 = os.path.getatime(filePath+"/"+filename) t4 = os.stat(filePath+"/"+filename).st_atime t5 = os.path.getmtime(filePath+"/"+filename) t6 = os.stat(filePath+"/"+filename).st_mtime t7 = os.path.getsize(filePath+"/"+filename) t8 = os.stat(filePath+"/"+filename).st_size shutil.copyfile(filePath, newPath) shutil.copytree(filePath,newPath) shutil.move(filePath, newPath) os.rename(filePath,newPath) os.remove(filePath+"/"+filename)
os.rmdir(filePath)
shutil.rmtree(filePath)
|