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



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!");
           return;
   }

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

   fclose(fpOutStream);
}
=======================================

Thanks again Simon.
Jason

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

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists       
                                                                  
   http://www.flybynight.com.au/                                  
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\   
   Fax:   +61 3 9419 0175   mailto: shc@xxxxxxxxxxxxxxxxx   \ /   
                                                             X    
                 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,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.



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.