- How to get a list of all the USB removable storages attatched in the system using C?
- libusb_context * usb_ctx = NULL;
- int main()
- {
- ...
- libusb_init(&usb_ctx);
- ...
- libusb_exit(usb_ctx);
- ...
- }
- some_func()
- {
- ...
- libusb_device **list;
- ssize_t number_of_devices = libusb_get_device_list(usb_ctx, &list);
- ...
- }