I'm trying to write a C program that goes through all USB devices and extracts some information from them. When I run
ls /sys/bus/usb/devices from the terminal, I get this output:
1-0:1.0 1-1.1 1-1.2 1-1.2:1.1 usb1 1-1 1-1.1:1.0 1-1.2:1.0 1-1:1.0
ls within a
system() call in C only shows the following devices:
1-0:1.0 1-1 1-1.1 1-1.1:1.0 1-1:1.0 usb1
I can't think of a reason why the rest of the devices aren't showing, maybe something to do with permissions? Is there anyway to get all of them to display?