[comp.sys.amiga] How does Newzap work?

cjp@antique.UUCP (Charles Poirier) (01/03/89)

One tip on using NewZap:  Great as it is, it seems to have a problem
with files read from VDK: or RAM:.  I had similar problems.  Copy your
file to a backup location on disk and NewZap the disk-based copy --
I bet the problem vanishes.

-- 
	Charles Poirier   (decvax,ucbvax,mcnc,attmail)!vax135!cjp

   "Docking complete...       Docking complete...       Docking complete..."

dykimber@phoenix.Princeton.EDU (Daniel Yaron Kimberg) (01/04/89)

In article <5079@phoenix.Princeton.EDU>, I wrote that I was having trouble
using newzap.  The symptoms were general bizarreness, including that it
didn't do anything useful, except by accident or coincidence.  The problem
turns out to be that I was using it on files in my vdk: device.  Apparently
it chokes on them, while working just fine with ram: and floppies.  I could
take a couple of guesses as to why, but I suppose I'll just use it on files
on more well behaved devices, and leave it at that.

                                         -Dan

shf@well.UUCP (Stuart H. Ferguson) (01/06/89)

+-- dykimber@phoenix.Princeton.EDU (Daniel Yaron Kimberg) writes:
| In article <5079@phoenix.Princeton.EDU>, I wrote that I was having trouble
| using newzap.  The symptoms were general bizarreness, including that it
| didn't do anything useful, except by accident or coincidence.  The problem
| turns out to be that I was using it on files in my vdk: device.  Apparently
| it chokes on them, while working just fine with ram: and floppies.  

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.

The author apparently knows about the problem.
-- 
		Stuart Ferguson		(shf@well.UUCP)
		Action by HAVOC

jesup@cbmvax.UUCP (Randell Jesup) (01/10/89)

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?

-- 
Randell Jesup, Commodore Engineering {uunet|rutgers|allegra}!cbmvax!jesup

shf@well.UUCP (Stuart H. Ferguson) (01/11/89)

+-- 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

cjp@antique.UUCP (Charles Poirier) (01/12/89)

In article <5650@cbmvax.UUCP> jesup@cbmvax.UUCP (Randell Jesup) writes:
<In article <10234@well.UUCP> shf@well.UUCP (Stuart H. Ferguson) writes:
<>It [VDK] 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?

Are you sure about this?  I don't have my Amiga manual with me, but in Unix 4BSD,

LSEEK(2)  Upon successful completion, the current file pointer value is returned.

As in, pos = lseek(fd, 0, 2) gives the file size.

-- 
	Charles Poirier   (decvax,ucbvax,mcnc,attmail)!vax135!cjp

   "Docking complete...       Docking complete...       Docking complete..."