openlang

Sending stderr into stdout under Windows

Hello.

I'd like the output produced by Arg.usage to be written to stdout rather than stderr, without having to restructure my entire older program. Here's my attempt:

Unix.dup2 Unix.stdout Unix.stderr; (* send output to stdout. *)
Arg.usage (Arg.align (hiddenhelp @ options)) “”

(The program exits afterwards, so I assume there's nothing we must restore…).

On Unix this works, but Windows produces nothing on either stdout or stderr. The entry for dup2 in the Unix documentation doesn't mention anything about Windows.

Any suggestions?

The conversation continues 3

Follow the reasoning
  1. Permalink

    It seems to work here - could you provide a complete reproduction, including the compiler version and so on?

Other sides of the same question

  1. Using MATLAB through Google Colab

    Can MATLAB commnads be used from Google Colab (cloud-hosted Jupyter)? For instance, I'd like to invoke Risk Management Toolbo…

    Replies 2Latest activity matlab
  2. Can gdb set a breakpoint for an assembly instruction using its address?

    My attempt: apparently this command does not exist, though. Can gdb do something like this?

    Replies 2Latest activity assembly
  3. Can Playwright assertions allow either of two possible text values?

    I'd like to verify that the text contains either one or two: Can this be made to work in Playwright? Could the same thing als…

    Replies 2Latest activity typescript