[futurebasic] Re: Trash volRef%

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 1998 : Group Archive : Group : All Groups

From: Rick Brown <rbrown@...>
Date: Tue, 28 Apr 1998 20:26:05 -0500
Aaron wrote:
> I'm calling it like this: 
> err= FN FINDFOLDER
> (_kOnSystemDisk,_kTrashFolderType,_kDontCreateFolder,foundVRefNum%,foundDirI
> D&).  
> 
> The fucntion looks like it'll return in foundVRefNum% the volume reference
> of the Trash, yet it's returning the root level of the startup disk.  Am I
> calling it right?  What I'm trying to do is move the app to the Trash when
> it's finished.

It sounds like what you are trying to find is a "working directory
reference number" for the Trash.  This is often mistakenly called a
"volume reference number."

A true volume reference number is assigned to a _disk_, never to an
individual folder.  This means that there really is no such thing as the
"volume reference number" for the Trash.  The number returned in
foundVRefNum% (which was probably "-1" in your case) is the volume
reference number for the startup _volume_.  What this is saying is that
the Trash is "somewhere" on your startup volume.  The other number you
need is foundDirID&, which is the Trash's directory ID number.  Those
two numbers _together_ indicate the Trash folder; separately, they do
you no good.

There is a way you can take a (true) volume number and a directory ID
number, and from them generate a single number called a "working
directory reference number," which is a temporary number that stands for
your folder.  Most of the FB functions and statements are built around
the use of these w.d. ref. numbers, although you can just as easily work
without them, if you make use of the PARENTID statement.  Note that 9
times out of 10 where the FB doc's mention "volume reference number" or
"volRefNum," they're really talking about a working directory reference
number.

- Rick