Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!stpeter.Eng.Sun.COM!cmcmanis From: cmcmanis@stpeter.Eng.Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga.tech Subject: Re: Directories Summary: ExNext() has a bug Message-ID: <137954@sun.Eng.Sun.COM> Date: 27 Jun 90 19:49:29 GMT References: <3541@monu1.cc.monash.oz> Sender: news@sun.Eng.Sun.COM Organization: Sun Microsystems, Mt. View, Ca. Lines: 21 You are correct, there is a bug in the Orig Filesystem (but I believe it is fixed in FFS and the 2.0 FSes) That doing a Delete(), between ExNext()s would cause problems. And it isn't just your delete's some other task could delete a file out from under you as well. This has to do with the hash chains getting messed up when a delete occurs and the block that your current lock points to gets an invalid next pointer in it. I don't recall the fix off hand but Andy or Steve Beats may be able to clue you in. In the short term, you can just "mark for delete" those files you will be deleting (do a "duplock" and put them on a list of to be deleted files) until you get to the end, and then when you're done scanning the directory delete the files in the to-be-deleted list. -- --Chuck McManis Sun Microsystems uucp: {anywhere}!sun!cmcmanis BIX: Internet: cmcmanis@Eng.Sun.COM These opinions are my own and no one elses, but you knew that didn't you. "I tell you this parrot is bleeding deceased!"