Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!bacchus!mwm From: mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) Newsgroups: comp.sys.amiga.programmer Subject: Re: Checking to see if a file's a link Message-ID: Date: 29 Apr 91 17:09:35 GMT References: <15127@darkstar.ucsc.edu> Sender: news@pa.dec.com (News) Organization: Missionaria Phonibalonica Lines: 28 In-Reply-To: davids@ucscb.ucsc.edu's message of 28 Apr 91 20:56:13 GMT In article <15127@darkstar.ucsc.edu> davids@ucscb.ucsc.edu (Dave Schreiber) writes: Is there a way, under 2.0, to examine a file or directory from a program and determine whether or not it's a link? I'm trying to write a DU program that will avoid going in circles if there's a link in a directory to an ancestor of that directory. Yeah - check DirEntryType (or whatever you check to see if it's a directory). If the absolute value is 4, it's a link. This data is from my faulty memory, so you should build a link and check the value. I am sure that it's a single absolute value, though. 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. Last time I reported this bug, I was told that they were going to "fix" the problem by having makelink not allow circular links. That this implied searching the entire subtree beneath the link didn't seem to bother the person who posted that fix. Bleah,