User forums > Help

[don't care]Program arguments, redirect output, >stdout.txt

(1/2) > >>

visir:
I just tried adding >stdout.txt to the Project->Set Program Arguments.

Didn't work. Program receives it as an argument, and no redirection happens.

visir:
Hm, don't do that on windows. It corrupted binary data, probably because it treated it as text.

Remade it as fopen("bw+"), it works now.

Figured it out from the fact that pcm_u16le sounded less noisy than pcm_s16le. Ascii text only takes first 128 possible values of a byte. I'm not sure if I'm lucky or the opposite. Holy shit. How the f*ck I made this connection.

BlueHazzard:

--- Quote from: visir on December 25, 2017, 06:05:27 am ---Hm, don't do that on windows. It corrupted binary data, probably because it treated it as text.

Remade it as fopen("bw+"), it works now.

Figured it out from the fact that pcm_u16le sounded less noisy than pcm_s16le. Ascii text only takes first 128 possible values of a byte. I'm not sure if I'm lucky or the opposite. Holy shit. How the f*ck I made this connection.

--- End quote ---

what are you talking about?


--- Quote from: visir on December 24, 2017, 08:39:53 pm ---I just tried adding >stdout.txt to the Project->Set Program Arguments.
Didn't work. Program receives it as an argument, and no redirection happens.

--- End quote ---
This obviously does not work. Your program needs a console host to run in it and the stream operator is a command of this console host, not for your program or windows. And also codeblocks does not know how to interpret the stream operator, because it is not a console host.

visir:
So I can't run programs that use stdin or stdout?

>what are you talking about?

Just one bug I had a problem with for a few days. Binary data was corrupted after passing stdout, but text worked fine.

stahta01:

--- Quote from: visir on December 25, 2017, 07:13:52 pm ---So I can't run programs that use stdin or stdout?

--- End quote ---

You can not use the CB run and use stdin or stdout.

I hope you know enough to run programs that use stdin or stdout?

If not, I suggest learning how to open an command prompt to run your program.

Edit: Once, you figure out how to use the "command prompt"; I would suggest loking at the CB tools menu or toolsplus plugin.

Tim S.
 

Navigation

[0] Message Index

[#] Next page

Go to full version