Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!slxsys!jonb From: jonb@specialix.co.uk (Jon Brawn) Newsgroups: comp.unix.internals Subject: Re: How do you find the symbolic links to files. Message-ID: <1990Nov26.150716.7268@specialix.co.uk> Date: 26 Nov 90 15:07:16 GMT References: <4899@trantor.harris-atd.com> <4900@trantor.harris-atd.com> <1990Nov26.082214.17329@oracle.com> Organization: Specialix International, London Lines: 34 jquinn@uk.oracle.com (John Quinn) writes: >bzs@world.std.com (Barry Shein) writes: >>>> How do you find the # of and locations of all links to a file? >>> This is an easy one. You cannot. >>> Well, sort of. You cannot determine which hard links to a file exist >>>without examining all the directories in a given file system, looking for >>>the specific inode of the file in question. Does anyone know of a tool to >>>do this? >> % ls -i foo >> 4924 foo >> % find /mount-point -inum 4924 -print >> -Barry Shein >ncheck is the tool for the job. >John D. Quinn. OK, so thats found all the real links. Reading the subject line, how do you find all the *symbolic* links? How do I access a symbolic link file to find out that it IS a symbolic link (I mean from within C, I assume stat( char *filename ) is going to stat the pointed too file?) Does 'find' have a wonderful flag for finding symlinks? Do any of ncheck/icheck/dcheck/fsck/fsdb/anything understand them? Also, what about old crusties like 'tar' and 'cpio'? What do they do? I assume they use good old fashioned stat (not having src I can't check), so aren't they going to be conned into making actual files instead of symbolic links?????? (Oh mummy! I don't like the sound of that!) Just curious this time.... -- Jon? -- jonb@specialix.co.uk "Never be sorry for a might have been."