× 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.



Hello All,
Ive read the archived articles but I still can't seem to get this to work:

I have a simple example, that I compile using CRTBNDC, with the option SYSIFCOPT(*IFSIO):

int
main( int argc, char ** argv ) {
   FILE *cso;
   FILE *cse;

char *captured = "./captured";

cso = freopen( captured,"w", stdout );

cse = freopen( captured, "a", stderr );

   fprintf( stdout, "This should not go to stdout but to a file!\n" );
   fprintf( stderr, "This should not go to stderr but to a file!\n" );

   fclose( cso );
   fclose( cse );

   exit(0);
}

After compiling and running it with:
call pgm(lib/thisprogram)

I get a terminal window, with the messages displayed.
If I go into qsh and set the variable QIBM_USE_DESCRIPTOR_STDIO="Y"
and execute the program ( /qsys.lib/mylib.lib/thisprogram.pgm )

If I compile and run this program under UNIX it works as youd think it would.

Any ideas? Im running OS400 V5R2.
Maybe this was addressed in a PTF? Im stumped here!

Thanks!

Walt Fles
the messages display as well.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.