[Buildbot-devel] Pipe ShellCommand output to file on Windows

Bob Hood bhood2 at comcast.net
Mon Jun 16 22:35:18 UTC 2014

On 6/16/2014 1:54 PM, Alex Escott wrote:
> As the title says... I have a ShellCommand step like this:
> Steps.append(ShellCommand(command=['xt-size.exe','libWhatever.a','--totals','>','memstats.txt']))
> When I run it, it gives an error:
> xt-size.exe: Warning: '>' is not an ordinary file
> xt-size.exe: 'memstats.txt': No such file

You might subclass ShellCommand (call it "ShellCommandToFile" or something),
and perform your own subprocess execution of the provided command that
captures stdout to a subprocess.PIPE.  Then you can read the output, and send
it to the file you require.

Since ShellCommand has 'want_stdout' and 'want_stderr' flags, I'd guess it's
already doing a capture of these output streams, so it should be fairly easy
to redirect it to your needs.

More information about the devel mailing list