Is there a way to redirect stdout from a low level API ... did not find a function or way to do this ....
The system call dupshould allow you to redirect stdout, as shown in this example .
dup
freopenwill also work if you are redirected to a file, but dupcan also be used with handsets and sockets.
freopen
I believe that dup2 (fd, 1) does the trick, for example. after opening fd with open ().
freopen(), .
freopen()
You can use freopen()to redirect stdout to a file. If you are using a posix-like system, you can use close(), dup()and open()although they work with file descriptors, not files.
close()
dup()
open()
Source: https://habr.com/ru/post/1755072/More articles:Using IN in where - phpHow to remove the left pad in this layout? - cssI do not understand this implementation of the Huffman algorithm - c ++Naming conventions for html / css + MVC? - javascriptМогу ли я передать результат шаблона xslt в качестве параметра в другой шаблон? - xsltNeed help displaying a randomly selected image when loading activity and clicking a button - javaDynamically linking a Python extension (.pyd) to another extension - pythondraw 3d faces as 2d - math= Try to exclude the template? - pythonget_model equivalent for ModelForms? - djangoAll Articles