Ich lese mit os.listdir(path) den Inhalt von path unter unix ein. Wie kann ich jetzt wissen ob es sich bei einem Element in der Liste um ein Verzeichnis oder eine Datei handelt?
gruß huppi
os.listdir(path)
-
- User
- Beiträge: 69
- Registriert: Donnerstag 29. August 2002, 17:10
- Wohnort: Erfurt
- Kontaktdaten:
os.path.
isfile(path)
Return true if path is an existing regular file. This follows symbolic links, so both islink() and isfile() can be true for the same path.
isdir(path)
Return true if path is an existing directory. This follows symbolic links, so both islink() and isdir() can be true for the same path.
islink(path)
Return true if path refers to a directory entry that is a symbolic link. Always false if symbolic links are not supported.
isfile(path)
Return true if path is an existing regular file. This follows symbolic links, so both islink() and isfile() can be true for the same path.
isdir(path)
Return true if path is an existing directory. This follows symbolic links, so both islink() and isdir() can be true for the same path.
islink(path)
Return true if path refers to a directory entry that is a symbolic link. Always false if symbolic links are not supported.