0

I'm testing out some stuff in libusb (C++), but is it possible to read data (like getting folders and files) from a USB flash drive using libusb?

I've searched for functions and stuff, but I haven't been able to find something. I'd love some examples that would just get me started. Right now I can get a list of devices, check if it is an USB flash drive and do libusb_open but then what?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
user1568364
  • 113
  • 3
  • 9
  • libusb would be used to communicate with the *actual USB device*. It sounds like what you want is to have the file system on the machine do the relevant communication and you talk to the filesystem. – ethrbunny Jul 05 '13 at 19:37

1 Answers1

2

You can't use libusb to directly read files from the flash drive, as libusb does not understand how to read the filesystem on the flash drive. Although you could write code to read from the filesystem on the drive, an easier solution would be to find out where the drive is mounted on the system (e.g. F:/ on windows, /media/myusb/ on linux), and then read from it using normal file access methods.

exrook
  • 90
  • 5