[comp.sys.mac.programmer] Deleting Resource Forks?

newman@ut-emx.UUCP (Dave Newman) (04/03/89)

Can someone suggest some code that will allow me to delete
the resource fork of a file?  I would like to obliterate
it entirely.  Pascal is preferable, but others that are
convertible by me would be OK.  I have some files with
empty resource forks that are taking up space on my disk,
and I'd like to smash those resource forks.  Unfortuately,
I don't have either FEdit+ or MPW, both of which, I am told,
will do the trick.

I've looked through such documentation as I have, and I see
no way to accomplish this little task.

Thanks for the assistance!

>>Dave

ech@pegasus.ATT.COM (Edward C Horvath) (04/03/89)

From article <11696@ut-emx.UUCP>, by newman@ut-emx.UUCP (Dave Newman):

! Can someone suggest some code that will allow me to delete
! the resource fork of a file?  I would like to obliterate
! it entirely.  Pascal is preferable, but others that are
! convertible by me would be OK.  I have some files with
! empty resource forks that are taking up space on my disk,
! and I'd like to smash those resource forks.  Unfortuately,
! I don't have either FEdit+ or MPW, both of which, I am told,
! will do the trick.

You'll need Inside Mac v. I plus either II or IV for details, but a
direct way to do this is
	- call SFGetFile to let the user pick a file
	- call OpenRF with the volume/name from SFGetFile to open
	  the resource fork
	- call SetEOF to truncate the fork to 0.
	- call FSClose.
	- loop if desired (until the SFReply.good is FALSE).

=Ned Horvath=