[comp.sys.mac.programmer] TCL's CResFile.Open in C vs. Pascal

jfrancis@umaxc.weeg.uiowa.edu (Jeff Francis) (04/11/90)

While porting a few classes from THINK C's TCL to THINK Pascal's TCL I
ran into this.

THINK C's CRefFile::Open method does the following to open a resource
file:
	refNum = HOpenResFile(volNum,dirID,name,permission);

While, THINK Pascal's CRefFile.Open method does this:
	temp := HOpenRF(volNum, dirID, name, permission, refNum);

They both then check to see if 'refNum' is -1 and then handle the error
case.  The class description says "Opening the file autmatically makes
it the current resource file."  This works in the C case but not in
the Pascal case.  Doesn't the Pascal call open the resource fork for
binary read/writes while the C call makes available the resources?
(i.e. HOpenResFile is actually a Resource Manager routine)  What is
the Pascal equiv. to HOpenResFile?

-jpf

-------------------------------------
Jeff Francis
THINK Class Library Evangelist and
CS Student, University of Iowa
jfrancis@umaxc.weeg.uiowa.edu
-------------------------------------