[futurebasic] Re: Trash volRef%

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

From: Mars Saxman <marssaxman@...>
Date: Tue, 28 Apr 98 17:41:05 -0800
>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.

This is exactly what it's supposed to do. FindFolder (and all of the 
other System 7 and up HFS calls) use a combination of a directory ID and 
a volume ID. The volume ID is the number of the drive; the directory ID 
is the number of the folder within that drive. Since the trash is always 
on the startup disk, the "volume reference of the Trash" and the "root 
level of the startup disk" are the same thing.

When you call FindFolder, it is giving you exactly what you ask for: the 
volume reference and the directory ID.

The reason this is so confusing is that FutureBASIC often calls a working 
directory ID a "volume reference number". This is a holdover from the 
pre-Mac Plus, 400k-single-sided MFS days when they were the same thing. 
(They aren't, on any system able to run FB.)

A working dir ID is a 16 bit integer that identifies an active directory. 
It tells the system how to find the specific folder on whichever disk it 
lives on.

So: to get to the point, you need to use OPENWD to get into the trash. 
That'll give you a working directory ID, which is apparently what you're 
after.

-Mars