Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!marshall From: marshall@sdd.hp.com (Marshall Clow) Newsgroups: comp.sys.mac.programmer Subject: Re: Resources Message-ID: <1991May02.203933.29682@sdd.hp.com> Date: 2 May 91 20:39:33 GMT References: <1991May2.161706.12121@cs.umu.se> Organization: Hewlett Packard, San Diego Division Lines: 26 In article <1991May2.161706.12121@cs.umu.se> dvljrt@cs.umu.se (Joakim Rosqvist) writes: >I am trying to copy a file from within a program. It contains resources only. >If I use Resource manager and call CountTypes, I will get all the types >of *all* open resource files, I just want those in that specific file. >UseResFile will let me skip some of the files, beginning with the one I >wanted to examine, so it won't work either. >Inside Machintosh told me that i should use OpenRF in File Manager for >"block level operations" >I used it and tried to read data with FSRead ===> boooom. >How should it be done? > IM-IV page 15 documents Count1Types and Count1Resource, which do what you seem to want. My question is, what do you really want? Do you wish a new file that contains the same resources as the old file? Do you want a file that is byte for byte identical to the old file? How about the creator and file type? Finder Info? Creation and modification date? If you copy a locked file, should the copy be locked? I have a routine I wrote a few years ago that handles all of these (I think) If there is an interest, I can post it. Marshall Clow marshall@sdd.hp.com