In java, you can use File.listRoots()
to get all drives in the system.
I'm looking to get only the external drives, i.e. USB drives, external hard disks, optical drives, floppy, etc.
Is there any way to do it in java? If not, native C++ code would be good as well. In that case, I need both Windows and Linux code.