Auslesen von Speicherdatum Verzeichnis und Datei
Verfasst: Dienstag 21. Dezember 2021, 10:32
Ich möchte das Speicherdatum von Verzeichnissen und Dateien ausgeben. Leider funktioniert der Code nicht an jeder Stelle. Kann wer helfen?
Dazu folgender Code
import os
import time
for (root,dirs,files) in os.walk('./Test'):
print("Root:" + str(root),time.ctime(os.path.getmtime(root))) <- Funktioniert
print("Verzeichnisse: " + str(dirs),time.ctime(os.path.getmtime(dirs))) <- Funktioniert nicht
print("Dateien: " + str(files),time.ctime(os.path.getmtime(dirs))) <- Funktionert nicht
Dazu folgender Code
import os
import time
for (root,dirs,files) in os.walk('./Test'):
print("Root:" + str(root),time.ctime(os.path.getmtime(root))) <- Funktioniert
print("Verzeichnisse: " + str(dirs),time.ctime(os.path.getmtime(dirs))) <- Funktioniert nicht
print("Dateien: " + str(files),time.ctime(os.path.getmtime(dirs))) <- Funktionert nicht