You didn't mention platform, so I'll have to be generic in my Socratic method. Have you read this and/or this? What exactly have you tried thus far? Maybe we can point you in a better direction.
C-. | [reply] |
To be more specific, I need to determine if a modem, used for dial-up has a connection established or not.
I'll here assume that you know (or are able to determine) that there is a modem connected to the serial port. If so, this is probably not a Perl problem, but more of a modem problem.
If this is a "Hayes-compatible" modem, you'll need to read the users manual for the modem in question to determine what 'AT' commands are supported by the modem. You'll have to find out if there is any AT command that will tell you what you want to know.
"Livet är hårt" sa bonden.
"Grymt" sa grisen...
| [reply] |
If you're working under Solaris you can find out if a port/device is being used by issuing the fuser command.
Example:
fuser /dev/cua/a
will return the process id that is using the port if such a process exists.
metadoktor
"The doktor is in." | [reply] |
If you're on a UNIX system, you're probably best off looking for the lockfile. If you're on a win32 system, I don't really know, but you might want to try opening the port, and see if it fails?
Thanks,
James Mastros,
Just Another Perl Scribe
| [reply] |