How do you find the symbolic links to files.
Jon Brawn
jonb at specialix.co.uk
Tue Nov 27 02:07:16 AEST 1990
jquinn at uk.oracle.com (John Quinn) writes:
>bzs at 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 at specialix.co.uk
"Never be sorry for a might have been."
More information about the Comp.unix.internals
mailing list