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

How to know the sector size of a disk programmatically?

anything that doesn't fit to other groups.

How to know the sector size of a disk programmatically?

Postby alaipayuthe » Tue May 01, 2012 2:24 am

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
alaipayuthe
Active Member
 
Posts: 13
Joined: Fri Oct 16, 2009 7:01 am

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

Postby maschoen » Tue May 01, 2012 7:57 pm

Use stat() or fstat() on the device (/dev/hd0) and look at the structure member st_blocksize.
maschoen
QNX Master
 
Posts: 2715
Joined: Wed Jun 25, 2003 5:18 pm

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

Postby alaipayuthe » Wed May 02, 2012 5:33 am

Thank you Maschoen. I have checked it.

Regards,
Honey S
alaipayuthe
Active Member
 
Posts: 13
Joined: Fri Oct 16, 2009 7:01 am


Return to General Programming

Who is online

Users browsing this forum: No registered users and 3 guests