[comp.sys.mac.programmer] can I use PBHSetVol in this context...

sonenbli@oxy.edu (Andrew D. Sonenblick) (09/06/90)

I would like to hear other programmer's opinions as to whether the following
is "safe" or insights if they _know_ it is safe or unsafe:

PBHSetVol is not recommended because, in a nutshell, it renders subsequent
calls of GetVol or PBGetVol to receive current Volume Reference number
instead of the current Working directory reference number which can cause
many a program to fitfulize.  But can I safely do this:

GetVol(&volumeName,&savedVolume);
PBHSetVol(...);

/* do what I need to do */

SetVol(0,savedVolume);

This scenario apparently avoids the PBHSetVol problem by restoring the
working directory to what it was prior to the call.  Am I right?

Please gimme your two cents...	  Ando Moon.  Sonenbli@oxy.edu