lotus



previous page: 4.2) When can I use the HOpen, HCreate etc file calls? Are they only System 7 calls? (Files - Mac Programming)
  
page up: Mac Programming FAQ
  
next page: 4.4) How do I convert a wdRefNum as returned by SFGetFile into a vRefNum/parID pair to use with the HXxx calls? (Files - Mac Programming)

4.3) Why do you say wdRefNum sometimes and vRefNum sometimes? Why do you say parID sometimes and dirID sometimes? (Files - Mac Programming)




Description

This article is from the Mac Programming FAQ, by Jon Watte h+@austin.metrowerks.com with numerous contributions by others.

4.3) Why do you say wdRefNum sometimes and vRefNum sometimes? Why do you say parID sometimes and dirID sometimes? (Files - Mac Programming)

When the Mac first made an appearance in 1984, it identified files by
using a vRefNum (volume reference number meaning a floppy disk or later
hard disk) and a name. Once HFS saw the light of day, folders within
folders became a reality, and you needed a dirID as well to point out
what folder you really meant on the volume. However, older programs
that weren't being rewritten still knew nothing about directory IDs, so
Apple had SFGetFile make up "fake" vRefNums that didn't just specify a
volume, but also a parent folder. These are called wdRefNums (for
working directory) and were a necessary evil invented in 1985. You
should not create (or, indeed, use) wdRefNums yourself.

There is a system-wide table that maps wdRefNums onto vRefNum/parID
pairs. There is a limit to the size of this table. A dirID and a parID
is almost the same thing; you say "parID" when you mean the folder
something is in, while you say a "dirID" when you mean the folder
itself. If you for instance have a folder called "Foo" with a folder
called "Bar" in it, the parID for "Bar" would be the dirID for "Foo."

 

Continue to:















TOP
previous page: 4.2) When can I use the HOpen, HCreate etc file calls? Are they only System 7 calls? (Files - Mac Programming)
  
page up: Mac Programming FAQ
  
next page: 4.4) How do I convert a wdRefNum as returned by SFGetFile into a vRefNum/parID pair to use with the HXxx calls? (Files - Mac Programming)