Path: utzoo!attcan!lsuc!ncrcan!hcr!edwin From: edwin@hcr.UUCP (Edwin Hoogerbeets) Newsgroups: comp.sys.amiga.tech Subject: Re: Question about EXAMINE/EXNEXT Message-ID: <5307@hcr.UUCP> Date: 8 Mar 89 01:50:01 GMT References: <8374@netnews.upenn.edu> <757@microsoft.UUCP> <5977@bsu-cs.UUCP> Reply-To: edwin@hcrvax.UUCP (Edwin Hoogerbeets) Distribution: na Organization: HCR Corporation, Toronto Lines: 32 In article <5977@bsu-cs.UUCP> jbwaters@bsu-cs.UUCP writes: >In article <757@microsoft.UUCP>, w-colinp@microsoft.UUCP (Colin Plumb) writes: >> A few notes: apparently, there exists a wildcard-matching utility that >> unlocks a directory between calls to ExNext(). THIS IS A BAD THING. >The Manx scdir() function does this.... I have written a replacment for it >that I link in with most of my programs. [etc] >Does anyone have a replacment that avoids >leaving a lock if aborted, and avoids calling UnLock() after every call? Manx allows you to define the function _abort() which is called from the function Chk_Abort if ^C was pressed. Chk_Abort is called in the i/o routines. In any case, this allows you to clean up temporary files, free memory, and other neat things when someone tries to send a break to the program. So you could go ahead and leave your locks around, but clean them up with _abort(). Unfortunately, there is no way to put this into a library, is there? If you try to link your library containing the revised scdir and your _abort before the standard c.lib, _abort won't be needed and won't get linked in. Also, if you link your library after the c.lib, the linker will pick up the _abort already in c.lib, and will ignore yours! You can't win. Maybe you could rewrite the new scdir type function to take a lock as one of its arguments. This way you could do a scdir on any directory you want, and let the user worry about Locking and UnLocking the [directory] file. It is also my guess that this method would be re-entrant too. (added bonus!) Edwin