PySide6.QtCore.QDirListing.DirEntry¶
- class DirEntry¶
Synopsis¶
Methods¶
def
__repr__()
def
absolutePath()
def
baseName()
def
birthTime()
def
bundleName()
def
completeSuffix()
def
exists()
def
fileInfo()
def
fileName()
def
filePath()
def
fileTime()
def
isDir()
def
isExecutable()
def
isFile()
def
isHidden()
def
isReadable()
def
isSymLink()
def
isWritable()
def
lastModified()
def
lastRead()
def
size()
def
suffix()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
Warning
This section contains snippets that were automatically translated from C++ to Python and may contain errors.
Dereferencing a valid
const_iterator
returns aDirEntry
object.DirEntry
offers a subset ofQFileInfo
‘s API (for example,fileName()
,filePath()
,exists()
). Internally,DirEntry
only constructs aQFileInfo
object if needed, that is, if the info hasn’t been already fetched by other system functions. You can usefileInfo()
to get aQFileInfo
. For example:ItFlag = QDirListing.IteratorFlag() for dirEntry in QDirListing("/etc", ItFlag::Recursive): # Faster if dirEntry.fileName().endsWith(u".conf"): # This works, but might be potentially slower, since it has to construct a # QFileInfo, whereas (depending on the implementation) the fileName could # be known already if dirEntry.fileInfo().fileName().endsWith(u".conf"): ItFlag = QDirListing.IteratorFlag() for dirEntry in QDirListing("/etc", ItFlag::Recursive): # Both approaches are the same, because DirEntry will have to construct # a QFileInfo to get this info (for example, by calling system stat()) if dirEntry.size() >= 4'000 /* 4KB */: if dirEntry.fileInfo().size() >= 4'000 /* 4KB */:
- __repr__()¶
- Return type:
object
- absoluteFilePath()¶
- Return type:
str
- absolutePath()¶
- Return type:
str
- baseName()¶
- Return type:
str
- bundleName()¶
- Return type:
str
- canonicalFilePath()¶
- Return type:
str
- completeBaseName()¶
- Return type:
str
- completeSuffix()¶
- Return type:
str
- exists()¶
- Return type:
bool
- fileName()¶
- Return type:
str
- filePath()¶
- Return type:
str
- isDir()¶
- Return type:
bool
- isExecutable()¶
- Return type:
bool
- isFile()¶
- Return type:
bool
- isHidden()¶
- Return type:
bool
- isReadable()¶
- Return type:
bool
- isSymLink()¶
- Return type:
bool
- isWritable()¶
- Return type:
bool
- size()¶
- Return type:
int
- suffix()¶
- Return type:
str