Article View: comp.sys.amiga.tech
Article #6533Re: How do you send a DosPacket to a handler directly?
From: Randell Jesup
Date: Sat, 10 Nov 1990 22:36
Date: Sat, 10 Nov 1990 22:36
33 lines
2289 bytes
2289 bytes
In article <root.658802253@tirith.UUCP> 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!"
Technical Details
Message-ID:
<15788@cbmvax.commodore.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!pacbell.com!att!rutgers!cbmvax!jesupReferences:
<DEVEN.90Nov8180332@netserv2.rpi.edu> <1990Nov7.185224.4215@cbnewsc.att.com> <root.658802253@tirith.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <DEVEN.90Nov8180332@netserv2.rpi.edu> <1990Nov7.185224.4215@cbnewsc.att.com> <root.658802253@tirith.UUCP> Reply-To: jesup@cbmvax.commodore.com (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 33