Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Different values of Num Of Blocks and Block Size

Different values of Num Of Blocks and Block Size
Thread Tools
Fresh-Faced Recruit
Join Date: May 2001
Location: India
Status: Offline
Reply With Quote
Jun 26, 2001, 03:20 AM
 
hi,
I am developing a JAVA application for Mac OS X. In this application i am using a native method and using a Mac OS API method PBHGetVInfo() method to get the information about the total number of blocks and block size.

int DiskTotal=0;
HParamBlockRec aRec;
aRec.volumeParam.ioVolIndex=0;
aRec.volumeParam.ioVRefNum=FoundRef;
aRec.volumeParam.ioNamePtr=NULL;
PBHGetVInfo(&aRec, FALSE);
int aNumOfBlocks=aRec.volumeParam.ioVNmAlBlks;
long aBlockSize=aRec.volumeParam.ioVAlBlkSiz;
DiskTotal=aNumOfBlocks*aBlockSize;

And i m getting successfully the NumOfBlocks and BlockSize. But the

problem is that every time i compile and run the program i get a new

value of NumOfBlocks and BlockSize. Why is this so..?

Can anybody help?
Thanx
Rachna
     
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status: Offline
Reply With Quote
Jun 26, 2001, 07:02 AM
 
Well, Java runs in it's own virtual machine so perhaps the number of blocks and block size is a function of the state of the JVM at some time. BTW, block size should almost always return 4096k since that's the size of a block on an HFS volume and also the size of a page in memory.

Question: I thought that PBHGetVInfo was a C function. Did Apple port it to java?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:26 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2