Mail Archives: djgpp-workers/2003/01/18/06:59:09
Hello.
Laurynas Biveinis wrote:
>
> > HERE=`pwd`
> > ln -s /dev/env/FOO link
> > export FOO=../../somefile
> > echo Hello > $FOO
> > cat link
> > cd ..
> > cat link
Oops, obviously the last line should be:
cat <directory>/link
or:
cat $HERE/link
> > I don't think this will work, because the __solve_symlinks CVS code does
> > not resolve /dev/env/* inline. It will get the filename from link and
> > restart the resolution with /dev/env/FOO rather than `pwd`/$FOO. At least,
> > that's how I think it will work.
>
> I have not looked if it *should* work, but I've tried it and it did :) I
> guess it's because my code never goes back in path (just adds to it or
> discards completely).
Huh? I just backed out all the changes I made, did a CVS update and rebuilt
fileutils, sh-utils and textutils, then tried this:
bash-2.04$ cd /temp/
bash-2.04$ mkdir -p somewhere/over/the/rainbow
bash-2.04$ cd somewhere/over/the/rainbow/
bash-2.04$ pwd
c:/temp/somewhere/over/the/rainbow
bash-2.04$ HERE=`pwd`
bash-2.04$ ln -s /dev/env/FOO link
bash-2.04$ export FOO=../../somefile
bash-2.04$ echo Hello > $FOO
bash-2.04$ ls -l $FOO
-rw-r--r-- 1 rich root 7 Jan 18 11:55 ../../somefile
bash-2.04$ cat link
Hello
bash-2.04$ cd ..
bash-2.04$ cat rainbow/link
c:/djgpp.204/bin/cat.exe: rainbow/link: No such file or directory (ENOENT)
bash-2.04$ ls -l rainbow/link
lrw-r--r-- 1 rich root 510 Jan 18 11:55 rainbow/link ->
/dev/env/FOO
bash-2.04$ cat $HERE/link
c:/djgpp.204/bin/cat.exe: c:/temp/somewhere/over/the/rainbow/link: No such
file
or directory (ENOENT)
bash-2.04$ ls -l $HERE/link
lrw-r--r-- 1 rich root 510 Jan 18 11:55
c:/temp/somewhere/over/the/rainbow/link -> /dev/env/FOO
ls -l shows the link "link" as satisfied, when I am in $HERE, but broken, when
I am in "$HERE/..".
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -