Article View: comp.sys.mac
Article #1380Re: Saving vRefNum's
From: Earle R. Horton
Date: Fri, 14 Jul 1989 02:09
Date: Fri, 14 Jul 1989 02:09
26 lines
1623 bytes
1623 bytes
In article <84039@ti-csl.csc.ti.com> leeke@m2.UUCP (Steve Leeke) writes:
>I would like to be able to recursively scavange a directory for a
>certain type of file and save the vRefNum when a file of a certain
>type is found. I've included to code I'm using by it seems to cause
>problems since the working directory is closed after I save the
>vRefNum, but if I leave it open I wind up with too many working
>directories open. Any suggestions?
The solution is simple. Instead of saving the working directory
reference number, save permanent information which can be used to find
the place where the file is. Save the volume reference number and the
directory ID of the folder where the file was found. You can use
PBGetWDInfo or the new GetWDInfo glue for this purpose, once you have
the working directory reference number. Then close the working
directory, since you won't need it until you look for that file again.
If anyone tells you to save the pathname, don't listen.
Earle R. Horton
"People forget how fast you did a job, but they remember how well you
did it." Salada Tag Lines
Technical Details
Message-ID:
<14409@dartvax.Dartmouth.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bloom-beacon!bu-cs!dartvax!eleazar.dartmouth.edu!earlehReferences:
<84039@ti-csl.csc.ti.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bloom-beacon!bu-cs!dartvax!eleazar.dartmouth.edu!earleh From: earleh@eleazar.dartmouth.edu (Earle R. Horton) Newsgroups: comp.sys.mac Subject: Re: Saving vRefNum's Message-ID: <14409@dartvax.Dartmouth.EDU> Date: 14 Jul 89 02:09:04 GMT References: <84039@ti-csl.csc.ti.com> Sender: news@dartvax.Dartmouth.EDU Reply-To: earleh@eleazar.dartmouth.edu (Earle R. Horton) Organization: Thayer School of Engineering Lines: 26