[Pharo-project] OSProcess $PATH
How do I add to $PATH for an OSProcess command? Thanks. Sean -- View this message in context: http://forum.world.st/OSProcess-PATH-tp3603346p3603346.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
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 -- View this message in context: http://forum.world.st/OSProcess-PATH-tp3603346p3606341.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
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
participants (2)
-
David T. Lewis -
Sean P. DeNigris