[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: link type="relative"
From: |
Chris Edillon |
Subject: |
RE: link type="relative" |
Date: |
Sat, 20 Apr 2002 11:58:26 -0400 (GMT+4) |
On Fri, 19 Apr 2002, Christopher Hahn wrote:
> I ask about the "type=relative" option because using a line like:
>
> /foo/bar/snark/filename.ext ->! newname.ext
>
> # ./cfenginefiles/cfBINengineSTAGING.sh
> cf:qapackager:./cfenginefiles/cfBINengineSTAGING.sh:141: Links requires path
> or varitem
> cf:qapackager:./cfenginefiles/cfBINengineSTAGING.sh:141: parse error
> cfengine:qapackager::Execution terminated after parsing due to errors in
> program
>
> So, it was my thinking that fully qualifying the name (newname.ext)
> might solve my problem, but then the "type=relative" option would
> have to work, but it does not appear to.
>
the "to" argument (second argument) must be either an
absolute path or a relative path. if you write it as an
absolute path:
/link/name -> /path/to/file
and set type=relative, the resultant path to the destination
becomes a relative one. however, you still have to specify
the fully-qualified path so that cfengine knows where to
start from. so, the following:
/tmp/foo -> /data/foo
creates a link called /tmp/foo which points to the absolute
path:
% ls -l /tmp/foo
lrwxrwxrwx 1 root root 3 Apr 20 12:05 /tmp/foo -> /data/foo
but using type=relative makes the path to the destination
file relative to the link itself:
/tmp/foo -> /data/foo type=relative
% ls -l /tmp/foo
lrwxrwxrwx 1 root root 3 Apr 20 12:05 /tmp/foo -> ../data/foo
so the following two arguments to a links: command end up
giving you the same results:
/tmp/a -> /tmp/b type=relative
/tmp/a -> ./b
both producing:
% ls -l /tmp/a
lrwxrwxrwx 1 root root 3 Apr 20 12:05 /tmp/a -> ./b
hope this helps,
chris