how to rtPrintf() to a file?

I want to rtPrintf() to a local file, is there any method to do this?

Not directly. The prints goes to an internal buffer of user defined size. The buffer contents are printed to the standard output after a launch.
It’s just a debug functionality and should never be enabled in a release version of an app, so there is little functionality to control it.

Inside a command prompt you could route the standard output stream to a new file with the “>” symbol like this: app.exe > output.txt.
“2>” does the same for the standard error stream.