Path: utzoo!attcan!uunet!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.sys.amiga.tech Subject: Re: Indicating end of file Message-ID: <14935@cbmvax.commodore.com> Date: 8 Oct 90 01:29:12 GMT References: <924@ucsvc.ucs.unimelb.edu.au> <1990Sep23.174736.16118@lavaca.uh.edu> <83986@tut.cis.ohio-state.edu> <14646@cbmvax.commodore.com> <14669@cbmvax.commodore.com> <1990Oct3.172801.26802@jato.jpl.nasa.gov> Reply-To: jesup@cbmvax.commodore.com (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 55 In article <1990Oct3.172801.26802@jato.jpl.nasa.gov> jdickson@jato.Jpl.Nasa.Gov (Jeff Dickson) writes: > copy SID:2400,1,8,N,031 sidout ... > If the file exists, Copy concludes by printing the message, >"Error during writing - sidout removed". Otherwise, copy doesn't >print an error, but I can't Type the file because (I guess) the >end of file (^J ?) has been obscured. Funny thing is according to >the List command, the file contains the same number of bytes as >the characters I typed on the terminal. There is no "end of file" character in amigados. It almost sounds like the file was never closed. > ACTION_LOCATE_OBJECT > ACTION_EXAMINE_OBJECT > ...so that the whatever is inputing from > the SID doesn't give up because there is > nothing to read, I block the DOS packet > until something does become available. > > When the DOS request can be satisfied, I > insert the number of bytes available in > the 'fib_Size' field and the number of > blocks in the 'fib_NumBlocks' field (usally > zero). I have no idea what to initialize > the 'fib_DiskKey' field as. I've tried -1 > and 0. Copy makes use of the fib_Size field. You actually might wish to reject the ACTION_LOCATE_OBJECT packet with ERROR_ACTION_NOT_KNOWN. This tells copy (and other system routines/commands) that you're a handler and not a filesystem (2.0 has an ACTION_IS_FILESYSTEM packet). The standard SER:, PAR:, etc reject lock attempts. ... > ACTION_END > > I have a rather old Transactor magazine that includes an article >on AmigaDOS. It says on end of file that the 'RES1' field of the DOS packet >is to contain a -1 (DOSFALSE) and that the 'RES2' is to contain the end of >file indication (in my case zero). I tried that, but it didn't work. So >now, I just put zero in the 'RES1' field when end of file occurs. URK! DOSTRUE is -1, DOSFALSE is 0 (aka FALSE). Most boolean routines/actions return this. Read and Write return the length read or written, or 0 for end of file, or -1 for an error. For all routines, the reason for the error is put in dp_Res2 (eventually it can be retrieved from pr_Result2 by IoErr()). See dos/dos.h for a listing of error codes. There is an example of a port-handler on the Washington devcon disk. -- 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!"