I have a program and somewhere it leaks the file descriptors, so I want to add a monitor thread to detect the process open fds, if the fd is a "PIPE" , I will close it. I could use lsof -p or cat /proc/pid/fd to get the process number, and I could also use the grep to filtr out the TYPE, but I wonder to know if there is built-in function in python which could used to get the type of file descriptor? something like this:
def getFdType(fd)