If I have a java path such as "/users/james/.myapp/" can I figure out the physical drive name (ie. \\.\PHYSICALDRIVE0
) using just java apis?
I thought this might be possible because you can reference a physical drive in java:
new RandomAccessFile("\\\\.\\PhysicalDrive0", "r");
If you need a solution to check a drive model number into Windows, you can try to read this through Windows Registry, some useful doc can be found here :read/write to Windows Registry
Current drives can be found in
HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices