Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!mcnc!wolves!deepthot!jay From: jay@deepthot.cary.nc.us (Jay Denebeim) Newsgroups: comp.sys.amiga.programmer Subject: Re: Checking to see if a file's a link Message-ID: Date: 2 May 91 14:07:40 GMT References: <15127@darkstar.ucsc.edu> <1991Apr29.160901.30173@kuhub.cc.ukans.edu> Organization: The Software Distillery Lines: 31 In article <1991Apr29.160901.30173@kuhub.cc.ukans.edu> markv@kuhub.cc.ukans.edu writes: >In article , mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) writes: >> In article <15127@darkstar.ucsc.edu> davids@ucscb.ucsc.edu (Dave Schreiber) writes: >> >> On a related topic, will the release version of Workbench 2.x have this >> sort of protection built into it's recursive commands (like dir)? >> Currently, if I have a directory 'foo', with a link to it's parent >> directory, and I do a 'dir foo all', dir ends up going in circles. Its fixed in all the commands now. >> >2.0 dos.library has a function called SameLock() that takes two locks >and returns TRUE if they are the same object (I think all it does is >check for a match of the handler and header block fields). With this, >just keep a Lock on each level of the tree you've walked down, and if >you step into a link, then check for a match with each parent. If >you get a match, you've made a cycle and skip that link, otherwise, >you can proceed with that link safely. This is what we did. Its a little more complicated than that, but that's close. -- |_o_o|\\ |. o.| || The Jay Denebeim | . | || Software | o | || Distillery | |// Address: UUCP: mcnc.org!deepthot.uucp!jay ====== Internet: jay@deepthot.cary.nc.us BBS:(919)-460-7430 VOICE:(919)-460-6934