I tried to get the PhysicalBytesPerSectorForPerformance value in FILE_STORAGE_INFO structure, using the GetFileInformationByHandleEx function using the following sample code:
FILE_STORAGE_INFO filestorageinfo; ULONG physicalsectorsize; if (GetFileInformationByHandleEx (filehandle, FileStorageInfo, &filestorageinfo, sizeof (filestorageinfo)) == FALSE) { return false; } physicalsectorsize = filsestorageinfo.PhysicalBytesPerSectorForPerformance;
While it worked correctly on Windows local path, it didn't give correct results for a network shared path:
On a network path, with Windows as server, got correct value 4096 bytes.
On a network path, with Linux as server, whose st_blksize/f_bsize value was 4096 bytes, got the value 512 bytes.
On a network path, with Mac OS as server, whose st_blksize/f_bsize value was 4096 bytes, got the error : OS Error (1): Incorrect Function.
Is there any other way to get this value correctly for remote paths?