Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

finding volume reference numbers

Posted on 1998-09-13
2
Medium Priority
?
203 Views
Last Modified: 2013-12-26
How can I find the volume reference numbers of ALL available  mounted volumes?
0
Comment
Question by:dwp090598
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

636 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