OSProcess $PATH

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

OSProcess $PATH

Sean P. DeNigris
Administrator
How do I add to $PATH for an OSProcess command?

Thanks.
Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess $PATH

Sean P. DeNigris
Administrator
env := OSProcess thisOSProcess environment copy.
path := (env at: #PATH), ':/opt/local/bin/'.
env at: #PATH put: path.
(PipeableOSProcess command: 'docsplit text "my_document.pdf"' environment: env workingDir: nil input: nil output: nil error: nil errorPipelineStream: nil) output

Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess $PATH

David T. Lewis
On Fri, Jun 17, 2011 at 12:59:27PM -0700, Sean P. DeNigris wrote:
> env := OSProcess thisOSProcess environment copy.
> path := (env at: #PATH), ':/opt/local/bin/'.
> env at: #PATH put: path.
> (PipeableOSProcess command: 'docsplit text "my_document.pdf"' environment:
> env workingDir: nil input: nil output: nil error: nil errorPipelineStream:
> nil) output
>
> Sean

Exactly right.

See also #environmentAt:put: which uses a primitive to call the C library
putenv() to set the value in the environment of the process in which the
VM is running.

Dave