Thanks for the response Simon.  

When I use the *NOIFSIO option, stdout is written to 
my QSYS file without any problem (i.e. MYLIB/MYFILE(MYMBR)).  
It seems that the IFS options (*IFSIO, *IFS64IO) are the ones 
that are failing.  It's strange because the IFS file is created 
successfully but stdout is still directed to the console.  

I'm trying to avoid running the program from a qshell like
"mypgm > out" just to override stdout/stderr.  

Could PASE help out here?  I'm wondering if this is an ILE issue.

Just for kicks, here is my sample program.

void main(int argc, char** argv)
   FILE *fpOutStream;

   fpOutStream = freopen("/tmp/test.out", "a", stdout);

   if( fpOutStream == NULL ) 
           printf("Failed to open standard output stream!");

   fprintf(stdout, "This is written to stdout!\n" );


Thanks again Simon.

-----Original Message-----
From: Simon Coulter [mailto:shc@xxxxxxxxxxxxxxxxx]
Sent: Tuesday, February 18, 2003 9:44 AM
To: C programming iSeries / AS400
Subject: Re: [C400-L] freopen() and IFS

Hello Jason,

Ensure you compile with SYSIFCOPT(*IFSIO). You can also use *ALL or 
*IFS64IO. If you do not do this then I/O is mapped to QSYS.LIB file for 
historical reasons.

Simon Coulter.
   FlyByNight Software         AS/400 Technical Specialists       
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\   
   Fax:   +61 3 9419 0175   mailto: shc@xxxxxxxxxxxxxxxxx   \ /   
                 ASCII Ribbon campaign against HTML E-Mail  / \   

This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

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-2022 by 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.