[Gambas-user] patch for setting directory on EXEC

Ian Haywood ihaywood at ...1979...
Sat Feb 23 13:09:36 CET 2013


as part of my app, I run the LaTeX typesetting program via EXEC in Gambas

To cut a long story short, latex likes to be an a specific current
directory, which isn't possible in Gambas: EXEC always runs the in the
directory the interpreter was started in, Currently I use SHELL
instead and do something like "cd the/directory/i/want ; latex
input.tex", but
this is inefficient (I have no other need of a subshell) and generally
feels kludgy.

This patch basically makes EXEC respect the PWD environment variable:
if PWD is set using the WITH keyword option to EXEC then
this is the current directory for the process spawned by EXEC.

Ian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gambas-pwd.diff
Type: application/octet-stream
Size: 973 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20130223/02359915/attachment.obj>


More information about the User mailing list