Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!pacbell.com!att!rutgers!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.sys.amiga.tech Subject: Re: How do you send a DosPacket to a handler directly? Message-ID: <15788@cbmvax.commodore.com> Date: 10 Nov 90 22:36:30 GMT References: <1990Nov7.185224.4215@cbnewsc.att.com> Reply-To: jesup@cbmvax.commodore.com (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 33 In article root@tirith.UUCP (Root) writes: >Noteworthy detail: You allocate the memory for the file handle, and pass >it to the filehandler, which will initialize its contents. You must >free this memory as well after you close the file. NOTE: if you must do this (instead of calling Open()), then as the original Dos Tech Ref Manual states, you MUST initialize all fields to 0, except fh_Pos and fh_End, which must be -1. I advise against allocating filehandles if there is a way to avoid it. Copying the contents of filehandles is right out. There was one totally unused field in a FileHandle that I have laid retroactive claim to (since it never did anything, and as mentioned above you had to initialize it to 0). This is fh_Link, soon to be known as fh_Flags. >Now, if you'll all carefully consult dosextens.h, you'll next ask "what >about those fh_Buffer and related fields - how are they used?". My best >answer is that beyond the fh_Task and fh_Arg1 fields, the filesystem is >not supposed to change anything. And the application program isn't >supposed to change anything period. So I presume they're dead space, >left over from BCPL and TriPos. (My money says ed and/or edit use >them though). All BCPL buffered IO uses them, as does the shell, etc. Under 2.0, all the buffered input/output routines use them. Don't touch. BTW, fh_Arg2 belongs to the filesystem also, though in reality it's almost useless since it's never passed anywhere. -- Randell Jesup, Keeper of AmigaDos, Commodore Engineering. {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com BIX: rjesup Common phrase heard at Amiga Devcon '89: "It's in there!"