Is there a way to change what a relative path is referencing after runtime has started?
My specific issue is that I have several existing 100,000+ LOC lua projects. I am building a new back-end in C/C++ for this by wrapping a Lua C library. The lua scripts use io.open("./path/relative/to/project/file") which translates to fopen(...) in C. The project file which this is relative to is opened by the user after the application has started.
I see two solutions, neither are particularly good:
1) Change every io.open() function in every project to be relative to a static location. I lose all flexibility if I do this.
2) Modify the Lua library to prepend a custom path to opened files. Modifying 3rd party libraries suck because you can't update the library without tracking patches.
3?) Ask cplusplus forum if there is a way to change the relative directory.