I have a windows cpp app and I want to resolve paths relative to a specific directory without changing the current directory. This means I can't use GetFullPathName
since it resolves paths relative to the current directory. Since this is a security sensitive issue I would rather not roll my own but use a sanctioned API.
I looked around for a good answer, but couldn't find anything. Surely this is a common issue for web servers or multithreaded environments. How do other people do this? Any help would be greatly appreciated.
For instance: You run your app from C:\appfolder\exes\myapp.exe
while the data is in C:\appfolder\data
. I want to resolve sillyfolder\..\mydata.txt
to C:\appfolder\data\mydata.txt
.