Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


From what I vaguely remember it is Windows that closes those streams for
GUI executables,

Something like that, yes, although they are not "closed" in the sense
that they would first be open ("inherited" in the Unix sense); they
are never open in the first place in GUI executables, unless
explicitly redirected when creating the process (which the shell,
cmd.exe, does when you redirect input/out from/to a file/pipe). (HEre
I talk about the underlying Win32 file handles; the C library's file
descriptors, and the corresponding C++ streams probably *are* "open",
even if connected to invalid file handles.)

In Windows builds there used to be
a solver/$INPATH/bin/guistd.com or some such that if copied to the path
of soffice.exe and renamed to soffice.com and invoked instead preserved
stdout/stderr streams. Maybe it's still built.

Not for soffice, there we just have soffice.exe and soffice.bin. But
for unopkg we deliver three different exectuables: unopkg.com,
unopkg.exe and unopkg.bin, which start each others in that order, if I
understand correctly.

Now, if I understand the purpose of the outermost wrapper, the
guistdio == unopkg.com thing, that is probably not needed any more on
modern Windowses (XP or later) as it is possible for a process to
"attach" to the console (think controlling terminal in Unix terms) of
the parent process, and thus acquire the possibility to reopen its
stdin/out/err to the paren't process's console. Look for documentation
for AttachConsole(ATTACH_PARENT_PROCESS).

--tml

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.