fullpath in addition to realpath

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

fullpath in addition to realpath

Eyal Amir
It would be useful to have a function in glibc with identical
functionality to the win32 _fullpath function.  That is, it should
append the current working directory to the relative path.  Then
remove every "." from the path and go up a level in the path for every
"..".  It should NOT resolve symbolic links.

I haven't tested realpath enough to know (since it doesn't serve my
purposes) whether it resolves all ".." and "." or whether it just
resolves those that are at the beginning of the relative path.  It
would be useful if it resolved all so that you could specify a
relative path like "../here/there/../basename.txt" to represent
"../here/basename.txt".  Same goes for "fullpath" if it is

I need such a function (that doesn't resolve symbolic links) because
we never change our symbolic links but do sometimes change our
underlying directory structure.