Path: utzoo!attcan!uunet!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.sys.amiga.tech Subject: Re: AmigaDOS questions!! Message-ID: <15327@cbmvax.commodore.com> Date: 22 Oct 90 22:11:25 GMT References: <1990Oct11.212541.18365@hoss.unl.edu> Reply-To: jesup@cbmvax.commodore.com (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 36 In article <1990Oct11.212541.18365@hoss.unl.edu> 252u3130@fergvax.unl.edu (Phil Dietz) writes: >I've written a Zoo2Lzh program that does a list and converts zoo->lzh >through the system() command. Well anyway, everything goes >well until it hits the WHILE (ExNext(lock,&fi)); command. When it >hits it, it GURUS with a Disk Corrupt error. For somereason, if I >change it to (Examine(lock,&fi), the program works, BUT all the old >files have to be READ ALL OVER AGAIN! Where is the lock coming from? When was the original Examine() done? (You of course know that you must Examine() a directory lock before ExNext()ing...) Every time you do Examine(), you reset and ExNext will take you through all the files in the directory. Note that changing a directory while examining it will have, at best, "funny" effects. Deleting files causes the worst problems, since the file being examined with ExNext might be deleted, leaving no way to find the next file in the directory, or worse yet, it might have been reallocated for a new file header in a different directory. In the ram disk, it might end up referencing deallocated memory, leading to a guru or other very bad result. >Do I have to lock the directory again or call another function to a >directory, if I've heavily changed the contents earlier? Or do I have >to put in a wait cycle or something to allow all the floppy acces to be >done before it gets the next (ExNext(lock,&fi)) entry.... No, but to re-examine a directory, you must start with Examine(), and call ExNext() until you get ERROR_NO_MORE_ENTRIES. It really isn't clear what you're doing, I'm afraid. remember that people trying to help you have never seen your source code - please always try to post something that has all relevant information included, and if possible isolate any problems down as far as possible. -- 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!"