Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!att!tut.cis.ohio-state.edu!pt.cs.cmu.edu!henry!hairston From: hairston@henry.ece.cmu.edu (David Hairston) Newsgroups: comp.sys.mac.programmer Subject: Re: stdio, THINK C and APPLs Message-ID: Date: 24 Dec 90 17:27:49 GMT References: Organization: Gaia II Lines: 22 In-reply-to: vladimir@prosper.EBB.Eng.Sun.COM's message of 24 Dec 90 06:45:39 GMT [vladimir@prosper.EBB.Eng.Sun.COM (Vladimir G. Ivanovic) writes:] [] As far as I can tell, THINK C's implementation of stdio will not read [] anything from a file of type APPL. I've tried opening an application [] with both fopen() with "r" and "rb", and with open() with O_BINARY (the [] default) without success. No errors are returned by any call, just 0 [] bytes are read. [] [] Is my assumption that since there is no data fork, stdio thinks it's has a [] zero length file correct? Or am I doing something wrong? Does that mean I [] have to use Toolbox calls to copy an application? stdio calls access the data fork of a file. typically, in an APPL all the interesting stuff is in the resource fork and the data fork is empty. there are toolbox calls that manipulate the resource fork in the way that you want. you might want to read Inside Macintosh I, chap. 5, The Resource Manager to get a better understanding of this. mac files are distinctly different than the concept of a file on, for example, unix. happy holidys, one and all! -dave- hairston@henry.ece.cmu.edu