Well, I'm working with 1-wire bus adapters and THEY care. There are differnt versions for serial, parallel and USB and I'd like to autoconfigure as much as possible. My reading of the the kernel discussion suggests that fixed major/minor numbers are deprecated. Are they reliable for distinguishing serial/parallel/USB? Paul On Sat, 2004-01-31 at 18:13, Theo v. Werkhoven wrote:
Fri, 30 Jan 2004, by palfille@earthlink.net:
Is there a way to tell if a device is a serial port, parallel port of USB from it's name?
I need this for a program I'm writing. I Want to detect which kind of device is given and treat them differently.
Why? They're all character devices under Linux, so for the kernel there's no difference.
But if must you can look at the major/minor device numbers. crw-rw---- 1 root lp 6, 0 Mar 14 2003 /dev/lp0 crw-rw---- 1 root uucp 4, 64 Mar 14 2003 /dev/ttyS0 ^^ ^^ There's a table in /usr/src/linux/Documentation/devices.txt
Theo