Solved

finding volume reference numbers

Posted on 1998-09-13
2
188 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 100 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 42
mixString challenge 36 123
Shell script to login to remote m/c and execute commands 10 78
x-bar in Google Sheets 2 55
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli‚Ķ
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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.

810 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