- can I set the current working directory when starting?

Is there a way to set the current working directory of a

I suspect that I can save my main app’s current working directory in a variable with Sys.getCwd(), change it with Sys.setCwd() before starting my, and then change it back to the original value after starting the process. Does that sound like it will work?


Followup: I confirmed that calling Sys.setCwd() before creating a instance successfully changes the working directory of the process. Feels hacky, but it works.

However, I wonder if this might have issues in multi-threaded projects where more than one thread might try to call Sys.getCwd() and Sys.setCwd() at the same time.

1 Like