RE: call rsh from .NET - source code?

From: Cowboy (Gregory A. Beamer) - MVP (NoSpamMgbworld_at_comcast.netNoSpamM)
Date: 03/01/05


Date: Tue, 1 Mar 2005 06:39:02 -0800

With an API? It might be possible, but I do not know of any way. The Process
object is not the greatest methodology, necessarily, but it does allow you to
use standard in and standard out. Admitedly, it is effectively the same as
calling the command line from a command prompt (except programatically).

We use it regularly and have found the only time it causes us problems is
when the process finishes in a fraction of a second and does not leave time
to query standard out. In those situations, if the executable allows, we
write to a log and parse it. Yes, it is not an extremely sexy methodology,
but it works fairly easy, is easily maintainable and the learning curve is
not that high. The same problem could rear its ugly head through API calls,
however.

---
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"David Thielen" wrote:
> Hi;
> 
> I thought of this but I was hoping there was a way to do it without calling 
> rsh on the command line as that provides one more place things can go wrong 
> (rsh.exe not found, command line problem, etc.)
> 
> Is there a way to do this where I just call an API?
> 
> thanks - dave
> 
> 
> "Cowboy (Gregory A. Beamer) - MVP" wrote:
> 
> > Look at the Process object in the .NET help file. It will give you a basic 
> > idea of how to connect to any command line process. Sample:
> > 
> > http://www.codeproject.com/csharp/Csharp_CVS_Interface.asp
> > 
> > 
> > ---
> > 
> > Gregory A. Beamer
> > MVP; MCP: +I, SE, SD, DBA
> > 
> > ***************************
> > Think Outside the Box!
> > ***************************
> > 
> > "David Thielen" wrote:
> > 
> > > Hi;
> > > 
> > > Can anyone point me at some source code for calling rsh on both Windows and 
> > > unix servers where I pass in the command & arguments and get back the 
> > > standard output & error?
> > > 
> > > -- 
> > > thanks - dave


Relevant Pages

  • Re: system calls
    ... Writing a simple recursive file-deleter is fairly straightforward; ... If you really want to run a command line ... are better ways to do the operation from within the API, and be able to report to the user ... >I have looked at CreateProcess but found it complicated and unsatisfactory. ...
    (microsoft.public.vc.mfc)
  • Re: [Python-Dev] PEP 324: popen5 - New POSIX process module
    ... With the current API, you do this by checking if the return code is 127. ... The shell uses these return codes: ... the command was found but is not executable ... If you look at the popen5 implementation and PEP, ...
    (comp.lang.python)
  • Re: GPIB Multidevice API timeout
    ... the default command timeout is much too long to wait. ... this 'multidevice' API, that isn't an option. ... Does anybody know a GPIB command other than ibdev() that sets the bus ...
    (sci.electronics.design)
  • Re: Pattern for foo tool <-> API <-> shell|GUI
    ... code to separate the actual command implementations from the command-line ... I have some Python scripts, ... user Provide these parameters for a particular call to command API ... client could do some verification at the first place. ...
    (comp.lang.python)

Quantcast