View topic - How to know the sector size of a disk programmatically?

Page 1 of 1

How to know the sector size of a disk programmatically?

PostPosted: Tue May 01, 2012 2:24 am
by alaipayuthe
Hi all,

I am a newbie in QNX. I am using QNX6.5.0. I need to write a C++ program in which I need to find the sector size of a disk. I couldn't find any command till now. Could anyone please help me.

Thanks in advance,
Honey S

Re: How to know the sector size of a disk programmatically?

PostPosted: Tue May 01, 2012 7:57 pm
by maschoen
Use stat() or fstat() on the device (/dev/hd0) and look at the structure member st_blocksize.

Re: How to know the sector size of a disk programmatically?

PostPosted: Wed May 02, 2012 5:33 am
by alaipayuthe
Thank you Maschoen. I have checked it.

Regards,
Honey S