Hi Nicolas,
just use TSystem::OpenPipe() and ClosePipe(). See this example:
root [0] FILE *pipe = gSystem->OpenPipe("date", "r"); root [1] TString d root [2] d.Gets(pipe)
Cheers, Fons.
Nicolas Arnaud wrote:
>
> Hi,
>
> I'm looking for a short macro showing how to use the TSystem class to
> execute a system command (for instance |date| as a trivial example)
> inside a ROOT macro and to get the output of the command (not the
> status), for instance in an array of string/char.
>
> Thanks in advance,
>
> Nicolas
>
-- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland E-Mail: Fons.Rademakers_at_cern.ch Phone: +41 22 7679248 WWW: http://fons.rademakers.org Fax: +41 22 7669640Received on Tue Jun 20 2006 - 16:19:12 MEST
This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:59 MET