Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!mailrus!bbn!apple!well!shf From: shf@well.UUCP (Stuart H. Ferguson) Newsgroups: comp.sys.amiga Subject: Re: How does Newzap work? Keywords: newzap flakey weird is it me? Message-ID: <10307@well.UUCP> Date: 10 Jan 89 21:17:27 GMT References: <5079@phoenix.Princeton.EDU> <5121@phoenix.Princeton.EDU> <10234@well.UUCP> <5650@cbmvax.UUCP> Reply-To: shf@well.UUCP (Stuart H. Ferguson) Organization: The Blue Planet Lines: 30 +-- jesup@cbmvax.UUCP (Randell Jesup) writes: | In article <10234@well.UUCP> shf@well.UUCP (Stuart H. Ferguson) writes: | >I discovered when working on the IFF library that VDK: has a problem with | >seeking. It doesn't correctly return the new position after each seek, so | >if NewZAP was expecting this information it would probably go berserk. | Seek() is documented as returning the position in the file BEFORE the | Seek was done. Could you be more specific? Silly me. Of course, Seek() is supposed to return the old position, not the new position. I was doing some rather rigorous checking on seeks, something like (from memory): oldpos = Seek (stream, offset, CURRENT_POSITION); newpos = Seek (stream, 0L, CURRENT_POSITION); if (newpos - oldpos != offset) ERROR; Doing this on CBM provided devices, like df0: and ram:, did the right thing, but if I did this on vdk: I would consistently get seek errors. I changed the code to be less picky: oldpos = Seek (stream, offset, CURRENT_POSITION); if (oldpos == -1) ERROR; and vdk: then worked correctly. I don't know exactly what vdk: is doing, but it's return value seems to be wrong. -- Stuart Ferguson (shf@well.UUCP) Action by HAVOC