Python Stat Module
File stat constants — S_ISDIR, S_ISREG, S_IMODE, S_IFMT. This category documents 8 Python stat module entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example. The entries include: stat.S_ISDIR(), stat.S_ISREG(), stat.S_ISLNK(), stat.S_ISFIFO(), stat.S_ISSOCK(), stat.S_IMODE(), stat.S_IFMT(), stat.filemode(). stat.S_ISDIR() returns True if the file mode indicates a directory. stat.S_ISREG() returns True if the file mode indicates a regular file. stat.S_ISLNK() returns True if the file mode indicates a symbolic link. stat.S_ISFIFO() returns True if the file mode indicates a FIFO (named pipe). stat.S_ISSOCK() returns True if the file mode indicates a Unix socket. Stat Module belongs to the System & OS group alongside OS Module, Sys Module, Platform Module, Getpass Module. You can also search across every category from the search page, browse the complete A–Z index, or try any example in the Python playground.