Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!lll-winken!iggy.GW.Vitalink.COM!widener!netnews.upenn.edu!msuinfo!convex.cl.msu.edu!jap From: jap@convex.cl.msu.edu (Joe Porkka) Newsgroups: comp.sys.amiga.programmer Subject: Re: Checking to see if a file's a link Message-ID: <1991Apr29.131157.2586@msuinfo.cl.msu.edu> Date: 29 Apr 91 13:11:57 GMT References: <15127@darkstar.ucsc.edu> Sender: news@msuinfo.cl.msu.edu Organization: Michigan State University Lines: 24 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, you gotta check the fib_FileType for specific values. I don't remember what the values are offhand, but its easy to find my making a simple program to Examine("afile") and print the resulting fib struct, then test it out on links and regular files. BTW, 1.3 can't tell the diff between a link and a real file, but it does not actually follow links. (Ie, file links and dir links are empty) >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. Hopefully. Currently it don't.