×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
hi Lim,
Not in all cases.
QtmhWrStout always writes to stdout. write(1: ....) always writes to
descriptor 1. But they aren't always the same thing.
If I understand correctly, the original implementation of C on OS/400
didn't have descriptors. So stdin, stdout, stderr were not associated
with a particular file descriptor.
Later, when descriptor support was added, IBM had to deal with the fact
that some people expected 0,1,2 to be mapped to stdin,stdout,stderr
(because that's how Unix works). So they invented an environment
variable, QIBM_USE_DESCRIPTOR_STDIO that controls this.
Furthermore, 0,1,2 always match stdin, stdout, stderr when you are in
QShell or PASE. I believe they also do when you are communicating with
the HTTP server (i.e. CGI programming)
But there are situations where they don't match, such as in the native
ILE environment (interactive or batch job) or when spawning a child job
manually via the spawn() API and mapping pipes to descriptors 0,1,2, or
when starting Java directly from RPG. In those cases, you have to set
the QIBM_USE_DESCRIPTOR_STDIO variable...
hockchai Lim wrote:
is it correct for me to assume that write() (using handle ID of 1) and
QtmhWrStout essentially does the same thing of writing the data to stdout?
thanks
As an Amazon Associate we earn from qualifying purchases.