Mail Archives: djgpp-workers/2003/01/23/16:26:11
Hello.
Below is a script that tries various tests and a log. A symlink
to c://dev/env/DJDIR/rdawe-test/symlink/d cannot be resolved.
Bye, Rich =]
---Start log---
create symbolic link `a' to `b'
create symbolic link `b' to `c'
create symbolic link `c' to `d'
foo
create symbolic link `t-dir/d' to `../d'
foo
create symbolic link `e' to `c:/../../../../../djgpp.204/rdawe-test/symlink/d'
c:/djgpp.204/bin/cat.exe: e: No such file or directory (ENOENT)
create symbolic link `f' to `/dev/env/DJDIR/rdawe-test/symlink/d'
foo
create symbolic link `g' to `c:/dev/env/DJDIR/rdawe-test/symlink/d'
foo
create symbolic link `h' to `c://dev/env/DJDIR/rdawe-test/symlink/d'
c:/djgpp.204/bin/cat.exe: h: No such file or directory (ENOENT)
---End log---
---Start test-sym.sh---
#!/bin/bash
CAT=${CAT-cat}
LN=${LN-ln}
MKDIR=${MKDIR-mkdir}
if [ "a$1" = "a-x" ]; then
set -x
shift
fi
# Chain of symlinks
$LN -fnsv b a
$LN -fnsv c b
$LN -fnsv d c
echo foo > d
$CAT d
# Relative symlink
$MKDIR -p t-dir
$LN -fnsv ../d t-dir/d
$CAT t-dir/d
# Too many dots
here=$(pwd)
dotty=$(echo $here | sed -e 's:/:/\.\./\.\./\.\./\.\./\.\./:')
$LN -fnsv ${dotty}/d e
$CAT e
# If this directory is under /dev/env/DJDIR, try putting that in a symlink.
drive=$(echo $here | sed -e 's!^\(.:\).*!\1!')
wibble=$(echo $here | sed -e "s!^$DJDIR!/dev/env/DJDIR!")
if [ "a$wibble" != "a" ]; then
$LN -fnsv ${wibble}/d f
$CAT f
if [ "a$drive" != "a" ]; then
$LN -fnsv ${drive}${wibble}/d g
$CAT g
# Chuck in an extra slash, to spice things up.
$LN -fnsv ${drive}/${wibble}/d h
$CAT h
fi
fi
---End test-sym.sh---
- Raw text -