Can't seem to catch some output from a program - not stdout or stderr. uhh.. help?
The program in question in Maya (by Autodesk).
I'm running a little test mel script that looks like so: Code:
print "MEL -- PRINT CALL\n"; maya -batch -script my_script 2> err maya -batch -script my_script 1> out Doing it that way, I see the first line in 'err' but don't see second in either. Is there a way I can see how the second line is being printed? |
hmm... found that maya is stealing stdout & stderr, and doing it's own thing with them. Not sure if I can do what I'm after at all.
If anyone knows, feel free to post, otherwise, I'm calling it quits on this one. |
I ran into something similar to this with MATLAB, where MATLAB would run over both 1 and 2 with whatever it felt like, so I wrote a wrapper that inserted a MATLAB command to open /proc/self/fd/3, then redirected 3 on the command-line. I gave it a name like script_out, and in the script I sent output there instead of standard output. This isn't MEL, but it should be obvious the correlation:
Code:
% prepended to the script: Code:
matlab (some stuff to trick it into running a script) 3>&1 1>&2 Code:
fprintf(script_out, '%s\n', row_data(1:length(row_data)-1)); Kevin Barry |
All times are GMT -5. The time now is 04:56 PM. |