Quantcast
Channel: Active questions tagged mac-osx-server - Server Fault
Viewing all articles
Browse latest Browse all 82

How to get PhysicalBytesPerSectorForPerformance for Remote Path in Windows?

$
0
0

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?


Viewing all articles
Browse latest Browse all 82

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>