I am using libusb library. I got to work to check the program if a USB stick is detected to. That I have to find out is if there enough memory on USB stick. Does anyone have an idea how to do it. Are in this libusb library parameters which say how much memory does USb stick has total and how much in used?
An memory stick will be installed as mass storage device and handled by the OS file system, unless you block the installation somehow. It's accessible by generic C file functions and additional Windows SDK functions.
What do you want to do with libusb? Read raw sectors, decode the boot block and FAT to determine the free storage capacity?
with libusb I detected all USB devices connected to my computer. I used libusb_interface_descriptor to sort all devices which are equal LIBUSB_CLASS_MASS_STORAGE. So now I have only USB sticks connected. My problem I have to check out if some Bytes(for example 500KByte) fit on this USB stick. I have no idea how to check it. I know how to check it on my computer using Properties of USB but how to detect it by using coding I don't know.
I already mentioned how it works:
- read master boot sector and possibly logical drives boot sectors
- determine the file system (FAT16/FAT32) from the boot sector entries
- read all FAT sectors and calculate free space
I already mentioned how it works:
- read master boot sector and possibly logical drives boot sectors
- determine the file system (FAT16/FAT32) from the boot sector entries
- read all FAT sectors and calculate free space