Have a look at realpath(3).  I think it is close to what you want.

It is a C interface, so you'd have to write a tiny C program to 
call it if you want to access it from scripts, etc. 

Perl may also have access to realpath thru a module, so it could
be embedded in a script that way. I haven't checked.

Karl


On Sat, 20 Oct 2001, [EMAIL PROTECTED] (Michael O'Donnell) wrote:
> 
> Let's call the "canonical" pathname of a given file the
> absolute pathname which is "most direct" ie. has no
> instances of "."  or ".."  in it.  So, if I have two
> directories /a/b/c and /d/e/f and a file named XYZZY in
> c, we can refer to it by many different pathnames, both
> absolute and relative.  For example, assuming we're
> standing in directory e all of the following can refer
> to XYZZY but only the last is the canonical pathname:
> 
>      f/../../../a/b/c/XYZZY
>    ./f/../../../a/b/c/XYZZY
>           ../../a/b/c/XYZZY
>      ../../a/b/../b/c/XYZZY
>           /a/b/c/../c/XYZZY
>         /a/b/c/../c/./XYZZY
>                /a/b/c/XYZZY
> 
> What I'm looking for is something that will provide
> the canonical pathname of a file no matter how one
> refers to it.  I can write a script to do this if I
> must but I'm hoping this capability already exists.


**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to