def is_unix_socket(path):
"""
Check if path is a valid UNIX socket.
Arguments:
path (str): A file name path
Returns:
True if path is a valid UNIX socket otherwise False.
"""
mode = os.stat(path).st_mode
return stat.S_ISSOCK(mode)
评论列表
文章目录