Hello All,
I've been trying to use OSProcess to execute commands; which works - however I need to be able to retrieve the value returned to the terminal by the command. To be precise, I am executing: OSProcess command: 'svn list svn://server/repo' and would like to retrive the string that is returned to the terminal. Could anyone advise on how to achieve this? Many thanks, John www.pinesoft.co.uk Pinesoft Computers are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com |
You need to use a PipeableOSProcess... should have come to me first, half
the cost... :-) > -----Original Message----- > From: [hidden email] > [mailto:[hidden email]]On Behalf Of John > Thornborrow > Sent: 24 October 2007 5:37 PM > To: [hidden email] > Subject: OSProcess - return value from command. > > > Hello All, > > I've been trying to use OSProcess to execute commands; which works - > however I need to be able to retrieve the value returned to the terminal > by the command. > > To be precise, I am executing: > > OSProcess command: 'svn list svn://server/repo' > > and would like to retrive the string that is returned to the terminal. > > Could anyone advise on how to achieve this? > > Many thanks, > > John > www.pinesoft.co.uk > > > Pinesoft Computers are registered in England, Registered number: > 2914825. Registered office: 266-268 High Street, Waltham Cross, > Herts, EN8 7EA > > > > This message has been scanned for viruses by BlackSpider > MailControl - www.blackspider.com > > |
For example:
command := PipeableOSProcess command: 'svn list svn://server/repo'. output := command output inspect. error := command errorPipelineContents inspect. processExitStatus := command processProxy exitStatus inspect. The PipeableOSProcess class is part of the CommandShell package, because it provides the mechanism for connecting external processes to OS pipes for command line processing in CommandShell. I split the original OSProcess package into two pieces (OSProcess and CommandShell) because it had grown too large, and because simulating Unix command shells is not of general interest to most Squeak users. However this is a recurring question, so I guess I should find a way to move PipeableOSProcess back into the OSProcess package one of these days. Dave On Wed, Oct 24, 2007 at 06:26:51PM +0100, Gary Chambers wrote: > You need to use a PipeableOSProcess... should have come to me first, half > the cost... :-) > > > -----Original Message----- > > From: [hidden email] > > [mailto:[hidden email]]On Behalf Of John > > Thornborrow > > Sent: 24 October 2007 5:37 PM > > To: [hidden email] > > Subject: OSProcess - return value from command. > > > > > > Hello All, > > > > I've been trying to use OSProcess to execute commands; which works - > > however I need to be able to retrieve the value returned to the terminal > > by the command. > > > > To be precise, I am executing: > > > > OSProcess command: 'svn list svn://server/repo' > > > > and would like to retrive the string that is returned to the terminal. > > > > Could anyone advise on how to achieve this? > > > > Many thanks, > > > > John > > www.pinesoft.co.uk > > > > > > Pinesoft Computers are registered in England, Registered number: > > 2914825. Registered office: 266-268 High Street, Waltham Cross, > > Herts, EN8 7EA > > > > > > > > This message has been scanned for viruses by BlackSpider > > MailControl - www.blackspider.com > > > > > |
> > The PipeableOSProcess class is part of the CommandShell package, because > it provides the mechanism for connecting external processes to OS pipes > for command line processing in CommandShell. I split the original > OSProcess > package into two pieces (OSProcess and CommandShell) because it had grown > too large, and because simulating Unix command shells is not of general > interest to most Squeak users. However this is a recurring question, so > I guess I should find a way to move PipeableOSProcess back into the > OSProcess package one of these days. > > Dave> That would be nice, I don't use the command shell but do need the pipes! Having talked with John it seems he's wanting to do this on Windows, which isn't supported, of course. |
> Having talked with John it seems he's wanting to do this on Windows, which
> isn't supported, of course. Till that you can take a look at: http://squeaksource.com/ProcessWrapper.html Cheers, Balázs |
Free forum by Nabble | Edit this page |