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 -- Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org ICBM 52 13 27N , 4 29 45E. SUSE 8.2 Kernel k_athlon-2.4.20 See headers for PGP/GPG info.