[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

finding volume reference numbers

Posted on 1998-09-13
2
Medium Priority
?
204 Views
Last Modified: 2013-12-26
How can I find the volume reference numbers of ALL available  mounted volumes?
0
Comment
Question by:dwp090598
2 Comments
 

Author Comment

by:dwp090598
ID: 1291527
figured out the solution to my problem using:

pb.ioNamePtr = aString;
pb.ioVRefNum = 0;
      
      for(i=1; aErr != nsvErr; i++)
      {
          pb.ioVolIndex = i;
          aErr = PBHGetVInfo((HParmBlkPtr)&pb, false);
 }
0
 
LVL 3

Accepted Solution

by:
boonstra earned 200 total points
ID: 1291528
Actually, you want to start with ioVolIndex = 0:

  HParamBlockRec hpBlock;
  HVolumeParam *hpb = &hpBlock.volumeParam;
  OSErr err;
  Str31 volName;
  short volIndex;
  Boolean notDone = true;
 
  hpb->ioNamePtr = volName;
  hpb->ioResult = 0;
 
  volIndex=0;
 
  do {
        hpb->ioVRefNum = 0;
        hpb->ioVolIndex = volIndex++;
        err = PBHGetVInfo(&hpBlock,false);
        if (noErr != err) break;

        p2cstr(volName);
        printf("Volume [%d] %s vRefNum = %d\n",hpb->ioVolIndex,volName,hpb->ioVRefNum);

  } while (notDone);

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question