Novaterata
Novaterata

Reputation: 4781

How could a command line tool print to console without stdout or stderr?

I've got a Windows CLI EXE that prints to the console when I run it. This is not a program I can modify.

I wrapped this in a gradle Exec task, and it clearly is running, but nothing is getting printed to the screen. I had not configured anything special with the output.

I ran the program directly again but used 1> and 2> to redirect stdout and stderr to files.

Because this program takes 3 hours to run I hit Ctrl-C after a while and opened the redirect files.

None of the usual output was in the files.

Could it be using backspace or some other mechanism to prevent output from capture? The output does not clear on the actual console. Any ideas would be helpful.

Upvotes: 1

Views: 1238

Answers (1)

Novaterata
Novaterata

Reputation: 4781

I found another program by the same author that does not take as long, so I was able to let it finish.

The program does in fact write to stdout, but it doesn't flush until the very end. Which would be 3 hours for the program in the question! I would have thought that flushing would impact the console as well as a redirect stream, but it appears to only impact redirects. This makes sense if you wanted to have an animated progress spinner or something like that. Since I can't update the program code.

It looks like I'm just stuck with no progress updates.

Upvotes: 1

Related Questions