Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!rutgers!cbmvax!johno From: johno@cbmvax.commodore.com (John Orr - CATS) Newsgroups: comp.sys.amiga.programmer Subject: Re: Checking to see if a file's a link Message-ID: <21041@cbmvax.commodore.com> Date: 29 Apr 91 14:06:20 GMT References: <15127@darkstar.ucsc.edu> Reply-To: johno@cbmvax.commodore.com (John Orr - CATS) Organization: Commodore, West Chester, PA Lines: 28 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? from : /* Types for fib_DirEntryType. NOTE that both USERDIR and ROOT are */ /* directories, and that directory/file checks should use <0 and >=0. */ /* This is not necessarily exhaustive! Some handlers may use other */ /* values as needed, though <0 and >=0 should remain as supported as */ /* possible. */ #define ST_ROOT 1 #define ST_USERDIR 2 #define ST_SOFTLINK 3 /* looks like dir, but may point to a file! */ #define ST_LINKDIR 4 /* hard link to dir */ #define ST_FILE -3 /* must be negative for FIB! */ #define ST_LINKFILE -4 /* hard link to file */ If you are using Examine() and ExNext() to do your directory scanning, just compare the FileInfoBlock's fib_DirEntryType field to the above #defines. --John