Loading a directory path to IPC

https://learninghub.kx.com/forums/topic/loading-a-directory-path-to-ipc

What is the approach to load a directory into a IPC Handle? It is system “cd /my/directory/f1” normally, but if i want that loaded into my h:hopen, I assume i have to do the system cd equivalent and pass to the handle?

so…
h:hopen 5000

h( system “cd /my/directory”)

Note/ Applicable to Question 3.1 of Advanced capstone

You can perform the “cd” command over IPC, but as this will change the current directory in the process, you should be sure that this won’t cause problems, as any code that depends on the current value of “cd” might break.

Also if you are sending the command as a string to the handle, you have to escape any embedded quotes:

h"system "cd /my/directory/f1""

Or you could use a lambda with a dummy parameter instead:

h({system "cd /my/directory/f1"};::)