How do you find the symbolic links to files.

Anton Rang rang at cs.wisc.edu
Sun Nov 18 19:09:13 AEST 1990


[ I broadened distribution to comp.unix.programmer since c.u.w is gone. ]

In article <4901 at trantor.harris-atd.com> tcurrey at x102a.harris-atd.com (currey tom 76327) writes:
>  I already explained this to my customer,  I was just wonder if someone
>had already figured out a 'find' command or graphical list of symbolic links.

  It's probably easiest to use the 'find -type l' trick that someone
already posted.  Slow, on a large file system, but it will get you all
of the symbolic links to an object.

>   Example:  A is the object and has links B,C,D,E,F
>
>     Output:    A--|
>		   |
>		   |-B--|
>		   |    |-C
>		   |    |-D
>		   |-E
>		   |-F

  Hmm.  I haven't quite figured this one out.  This picture makes it
look like B is a directory containing C, or something like that.  But
then they can't both be links to A...hmm.  Could you clarify a bit?

>The program I have designed would use major overhead for the system search,
>but it is fairly easy to maintain a table of these links if you
>start creating the tables first.

  If you need to do this for all of the files on the file system, you
could scan the file system, keeping track of all symbolic links as you
go ('find -type l' will do this), then run it through a program which
figures out which object (if any) they refer to.

  I don't think that keeping a table of the links would help if links
can be added and removed; you still need to scan the entire filesystem
to update your table.  (Of course, you could update it every night or
something like that, if that's reasonable.)

>  To let some people know about the $ cost of packages on VMS that
>to this is about $250,000+.

  Hmm.  Wait a minute.  First, VMS doesn't have symbolic links, so I'm
not quite sure what you mean by 'packages that do this.'  Second, I
don't know of any VMS software that costs that much, though I suppose
if you have enough machines and weird enough software....  (Hey, if
you want this for VMS, I'll write it up in a day for $50K.... :-)

>This might explain better I should have said in the first place.

  I'm still confused.  Do you mean something other than just
    'give me a list of all symbolic links which resolve to X'
  ?

	Anton
   
+---------------------------+------------------+-------------+
| Anton Rang (grad student) | rang at cs.wisc.edu | UW--Madison |
+---------------------------+------------------+-------------+



More information about the Comp.unix.programmer mailing list