我一直在寻找一个脚本,它可以对 HDD 进行碎片整理,但也可以通过os.walk()
. 但我什么也没找到。
import os
def run():
filestoscan = 0
list = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
length = len(list)
for i in range(0, length):
select = list[i]
error = 0
var = 0
for root, dirs, files in os.walk(select+':/', topdown=True):
for name in files:
var += 0
for root, dirs, files in os.walk(select+':/', topdown=True):
for name in files:
# do something
run()