Of interest, the realpath(1) function would do what this issue wants.
If you do something like (bash script here):
abspath=`realpath -m $cwd`
..the result is the proper "cleaned up" absolute path, with unncessary "." and ".."s removed.
In unix we have realpath(3), and under the Windows API there's the GetFullPathNameA() function.
So between those and some of the code I proposed in STR 3441, there might be a way to clean all this up.
Might be a lotta work, or might be a little. Either way a lot of testing is needed, cause there's a lot of side cases; in unix symlinks and multiple slashes, in windows uncs, drive maps, fronts vs backs, symlinks (MKLINK /?), junctions, and lord knows what else.
Beware of dragons in the OS functions; in the case of linux, realpath(3) doesn't work with fictional pathnames, but realpath(1) can with the -m flag, so there's some smarts in there to avoid realpath(3), doing some pathname parsing itself.
[ Direct Link to Message ]
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.