Unfortunately, I'm on Windows and I need POSIX realpath
.
Suppose that there's a dirpath variable in a CMD batch script:
FOODIR=D:/tmp/foo/bar/quux
where one or more middle components of the dirpath are symlinks (directory junctions in Microsoft parlance):
[/cygdrive/d/tmp]$ cmd /C dir /Ad /l
...
Directory of D:\tmp
...
2014-12-10 16:44 <SYMLINKD> foo [D:\storage\foo.canonical]
How to write a function which will transform %FOODIR%
into D:/storage/foo.canonical/bar/quux
?
Any solutions welcome.