in reply to Re: Following symlinks manually
in thread Following symlinks manually
Yes, much harder ;-)
Try this at the shell:
Now, take a look around for a bit. And then try your chase_links on foo.mkdir a mkdir b ln -s a S ln -s ../b S/S touch b/foo ln -s S/foo foo ln -s S/foo S/foo
Note the sleep in there - I did that to make it easier to kill, 'cuz it's going to go on forever.perl -e 'my $file = shift; while(defined(my $link = readlink $file)) { + print "LINK: $file\n"; $file = $link; sleep 1; } print "NOT LINK: $f +ile\n"' foo
One needs to keep careful track of current directories to figure out where the relative links are actually relative to.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Following symlinks manually
by davidrw (Prior) on Jan 15, 2007 at 23:06 UTC | |
by Tanktalus (Canon) on Jan 16, 2007 at 00:20 UTC |