What would be the best way in Python 2.7 to find out if a path is a socket?
os.path has is... functions for directories, normal files and links. The stat module offers some S_IS... functions like S_ISSOCK(mode) which I used as
import os, stat
path = "/path/to/socket"
mode = os.stat(path).st_mode
isSocket = stat.S_ISSOCK(mode)
print "%s is socket: %s" % (path, isSocket)
Is this the prefered way?