[comp.sys.mac.programmer] How does the Finder tell diskettes apart?

tedj@hpcilzb.HP.COM (Ted Johnson) (01/05/89)

I've always wondered how the Finder tells the difference between two diskettes
which have the same name.  I assume there is some sort of unique number
associated with each diskette when it is initialized.    

Does anyone know the real story?

-Ted

ephraim@think.COM (Ephraim Vishniac) (01/06/89)

In article <730076@hpcilzb.HP.COM> tedj@hpcilzb.HP.COM (Ted Johnson) writes:

>I've always wondered how the Finder tells the difference between two
>diskettes which have the same name.  I assume there is some sort of
>unique number associated with each diskette when it is initialized.

>Does anyone know the real story?

Logically, the information has to be somewhere in the volume
information (the stuff in block 2).  The only distinguishing fields I
see are drCrDate (initialization time), drLsBkUp (last modification
time), and the volume name.  My experience is that if you eject a
floppy, modify it on another machine, and re-insert it, it's
considered to be a different floppy.  So, the system certainly uses
drLsBkUp and probably drCrDate as well.

Reference: IM IV-161-166.

Ephraim Vishniac					  ephraim@think.com
Thinking Machines Corporation / 245 First Street / Cambridge, MA 02142-1214

	"He shook his head to clear a momentary system error."

blob@Apple.COM (Brian Bechtel) (01/06/89)

In article <35187@think.UUCP> ephraim@think.com (Ephraim Vishniac) writes:
>In article <730076@hpcilzb.HP.COM> tedj@hpcilzb.HP.COM (Ted Johnson) writes:
>
>>I've always wondered how the Finder tells the difference between two
>>diskettes which have the same name.  I assume there is some sort of
>>unique number associated with each diskette when it is initialized.
>
>>Does anyone know the real story?
>
>Logically, the information has to be somewhere in the volume
>information (the stuff in block 2).  The only distinguishing fields I
>see are drCrDate (initialization time), drLsBkUp (last modification
>time), and the volume name.  

The sequence I see in the ROM listings is:
	check the signature word in the VCB
	check the creation date in the VCB
	check the volume name.
if they match
	loop through any open files on the possibly remounted volume and see
	if they are still of the same length.

I don't see any test of last modification time.  Yes, this suprises me,
too.  I then went and tested this by modifying only the last
modification time of a volume, and it remounted successfully.

--Brian Bechtel		blob@apple.com		"My opinion, not Apple's"