Serial port

Hello …

Again the question. How to detect a busy serial port?
I have a list of system serial ports, but I do not know, which is already in use.
Thanks

Try to open it? If it’s in use, it should fail.