[comp.sys.mac.programmer] deleting resource fork

Karl Pottie <GHGAQA0@cc1.kuleuven.ac.be> (05/29/91)

How do I delete a resource fork without deleting the datafork
of a file ?
I'm using Think Pascal.

russotto@eng.umd.edu (Matthew T. Russotto) (05/30/91)

In article <91149.092256GHGAQA0@cc1.kuleuven.ac.be> GHGAQA0@cc1.kuleuven.ac.be (Karl Pottie) writes:
>
>How do I delete a resource fork without deleting the datafork
>of a file ?
>I'm using Think Pascal.

FSOpenRF(name, vrefnum, refnum)
SetEOF(refnum,0)
FSClose(refnum)
--
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
     .sig under construction, like the rest of this campus.

keith@Apple.COM (Keith Rollin) (05/30/91)

In article <91149.092256GHGAQA0@cc1.kuleuven.ac.be> GHGAQA0@cc1.kuleuven.ac.be (Karl Pottie) writes:
>
>How do I delete a resource fork without deleting the datafork
>of a file ?
>I'm using Think Pascal.

Open the resource for using something like OpenRF, and call
SetEOF(refNum, 0). Here's how I did it in a little Pascal
utility:

	FailOSErr(OpenRF(fileName, aFile.vRefNum, fileRefNum));
	FailOSErr(SetEOF(fileRefNum, 0));
	FailOSErr(FSClose(fileRefNum));


-- 
------------------------------------------------------------------------------
Keith Rollin  ---  Apple Computer, Inc. 
INTERNET: keith@apple.com
    UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith
"But where the senses fail us, reason must step in."  - Galileo