How to find the physical disk where the file / directory is located. I want to compare 2 files, and if they are on two separate disks, then I can speed up the comparison by reading both at the same time.
Hello
This may require P / Invoke.
A way to find out if two partitions are on the same physical hard drive without WMI?
Top link:
The Win32 function you need is called DeviceIoControl (). API documentation can be found at http://msdn.microsoft.com/en-us/library/aa363216(VS.85).aspx . Call DeviceIoControl () with the control code IOCTL_STORAGE_GET_DEVICE_NUMBER, and you will get a physical disk for this partition descriptor. The device handle for the partition can be restored using the CreateFile () API.
Read both at the same time.
In the worst case, this may be a little slower (depending on the actual physical disk (s)).
At best, it will be faster.
Source: https://habr.com/ru/post/1342463/More articles:Features iPhone SMS - iosUsing urllib2 to do SOAP POST, but I keep getting an error - pythonIsn't premature optimization? - c ++How to get time elsewhere programmatically in .NET? - dateHow to draw grids in OpenGL ES Android? - androidHow Magento uses the elements of the module_name tag in the module configuration file - configsed regex - matching text between two double quotes when the pattern is displayed in a string - linuxevent.originalEvent undefined in a focal event with jQuery autocomplete - jqueryWhat are the entities of namespaces and aliases in Doctrine2? - phpPerformance between Django and raw Python - pythonAll Articles