Discussion Overview
The discussion revolves around how to read a list of USB connections using C++ on Ubuntu OS. Participants explore methods to achieve this, comparing command line approaches with programmatic solutions.
Discussion Character
- Technical explanation
- Debate/contested
Main Points Raised
- One participant seeks assistance in using C++ to replicate the functionality of the "lsusb" command, which lists USB connections.
- Another participant references the man page for "lsusb," suggesting that it provides information on relevant files to read, specifically mentioning the /proc/bus/usb directory and /usr/share/usb.ids file.
- A participant questions whether the original inquiry is about obtaining the list of USB connections within a C++ program rather than from the command line.
- There is a discussion about the "system(...)" command in C, with one participant noting that it returns an int, typically a status code, rather than the output of the command, which complicates its use for this purpose.
- Another participant suggests that reading the files directly from the C++ program would still result in obtaining information in string format.
Areas of Agreement / Disagreement
Participants have not reached a consensus on the best approach to read USB connections in C++. There are differing views on the utility of the "system(...)" command and the implications of reading files directly.
Contextual Notes
There are limitations regarding the clarity of how to handle the output from system commands and the format of data retrieved from the suggested files.