Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to redirect/capture run output to a file ? #55

Open
GoogleCodeExporter opened this issue Mar 26, 2015 · 3 comments
Open

How to redirect/capture run output to a file ? #55

GoogleCodeExporter opened this issue Mar 26, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

I have a linker command which outputs map data to stdout.
I tried using "> output.map" which failed because it is passed as an argument 
to the command itself and not to the shell.

In the original makefile, i have the following to capture the map file:
link options -o output objects > output.map

Is there a way to capture the stdout and let stderr to go to screen ?

Probably tee.exe may help to redirect the output to a file but the issue is to 
redirect output of a command to its own output file.

version: 1.26
OS: Windows7 64-bit

Original issue reported on code.google.com by satis...@gmail.com on 5 Jan 2014 at 8:40

@GoogleCodeExporter
Copy link
Author

bump! I tried `shell(..., stderr=subprocess.PIPE)` but it raises 

TypeError: type object got multiple values for keyword argument 'stderr'

May be there is a way to allow this simply? Of course it's possible to directly 
use subprocess.

Original comment by wer...@beroux.com on 11 Aug 2014 at 2:34

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

And of course one could make it OS-specific, and use shell=True and shell pipe 
redirection of stderr to null.

Original comment by wer...@beroux.com on 11 Aug 2014 at 2:34

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Yes, the > re-direct notation is a shell thing, you need to run the command in 
the shell for it to work.

Original comment by ele...@gmail.com on 12 Aug 2014 at 1:47

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants