On Sun, 28 Jul 2013 01:53:16 +0200 Roland Mainz wrote:
> Attached (as "astksh20130727_readlink001.diff.txt") is the prototype
> patch for the readlink(1) builtin.

> ** Notes:
> * the builtin is currently at the level of functionality which
> FreeBSD's and busybox's readlink(1) utilities provide... plus -D
> * AST readlink(1) has an option to pass a directory fd to |readlinkat()|
> * GNU readlink provides these three extra options...
> -- snip --
>   -f, --canonicalize            canonicalize by following every symlink in
>                                 every component of the given name recursively;
>                                 all but the last component must exist
>   -e, --canonicalize-existing   canonicalize by following every symlink in
>                                 every component of the given name recursively,
>                                 all components must exist
>   -m, --canonicalize-missing    canonicalize by following every symlink in
>                                 every component of the given name recursively,
>                                 without requirements on components existence
> -- snip --
> ... are these options needed by anyone... and if "yes" ... what would
> be the best way to implement them ?

see src/lib/libast/path/pathcanon.c
the PATH_* flags handle all but the "all but the last component must exist" part
by default pathcanon() does logical canonicalization (not existence checks, no 
symlinks)

_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to