Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!cernvax!chx400!bernina!neptune!iiic.ethz.ch!umueller From: umueller@iiic.ethz.ch (Urban Dominik Mueller) Newsgroups: comp.sys.amiga.programmer Subject: Re: Checking to see if a file's a link Message-ID: <28449@neptune.inf.ethz.ch> Date: 2 May 91 11:27:14 GMT References: <15127@darkstar.ucsc.edu> <1991Apr29.160901.30173@kuhub.cc.ukans.edu> Sender: news@neptune.inf.ethz.ch Reply-To: umueller@iiic.ethz.ch (Urban Dominik Mueller) Organization: Departement Informatik, ETH, Zurich Lines: 20 >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. >Mark Gooderum Only... \ Good Cheer !!! >[huge .sig deleted] Nice idea, really. But it has its drawbacks, too. Remember the original question: Somebody wanted to create a 'du' type utility. Now if there is a link that points downward in the directory tree, the contents of that link (directory or file) will be counted twice. CSH has a built in 'du' like feature ('dir -v'), and there I have decided not to look at links at all. Comments? BTW: How fast is SameLock()? -U. Dominik Mueller umueller@iiic.ethz.ch .sig light!