Hi!
I am considering in using OSProcess to run an external application. I have tried: OSProcess waitForCommand: 'ls -l’ but this expression never return a value. I also tried: OSProcess command: 'ls -l /etc’ But it returns an ExternalUnixOSProcess. I am not sure what I can do with this. How can I get the result of the unix command? Sorry if these questions looks naive :-) Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi,
Maybe you should try to access: ExternalUnixOSProcess >>initialStdOut or exitStatus? Cheers, Vincent -----Message d'origine----- De : [hidden email] [mailto:[hidden email]] De la part de Alexandre Bergel Envoyé : vendredi 14 août 2015 00:11 À : Moose-related development Objet : [Moose-dev] simple question about OSProcress Hi! I am considering in using OSProcess to run an external application. I have tried: OSProcess waitForCommand: 'ls -l’ but this expression never return a value. I also tried: OSProcess command: 'ls -l /etc’ But it returns an ExternalUnixOSProcess. I am not sure what I can do with this. How can I get the result of the unix command? Sorry if these questions looks naive :-) Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis. This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by abergel
Hi Alex,
try the following: (PipeableOSProcess command: 'ls -l /etc/') output This works on OS X and on Linux, don’t know if it does on Win. > On Aug 13, 2015, at 19:11, Alexandre Bergel <[hidden email]> wrote: > > Hi! > > I am considering in using OSProcess to run an external application. > I have tried: > OSProcess waitForCommand: 'ls -l’ > but this expression never return a value. > > I also tried: > OSProcess command: 'ls -l /etc’ > > But it returns an ExternalUnixOSProcess. I am not sure what I can do with this. How can I get the result of the unix command? > > Sorry if these questions looks naive :-) > > Cheers, > Alexandre > -- > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: > Alexandre Bergel http://www.bergel.eu > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. > > > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev ---> Save our in-boxes! http://emailcharter.org <--- Johan Fabry - http://pleiad.cl/~jfabry PLEIAD and RyCh labs - Computer Science Department (DCC) - University of Chile _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Thanks!!!
Cheers, Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Administrator
|
In reply to this post by jfabry
Be careful with this. IIRC, depending on the command and how much output it returns, you can easily freeze your image. Do some experiments (e.g. #waitForCommand: vs. #command:, non-blocking output). There are ways to make it more robust, depending on the exact situation. Search the archives for something like "PipeableOSProcess nonblocking". HTH
Cheers,
Sean |
Free forum by Nabble | Edit this page |