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



After playing with this for a while I ended up writing two service programs to 
handle 'stream' type I/O in the IFS and QSYS file systems.
That allows use of both in a single program.  You could also just link to two 
separate modules.  Compile the IFS access module/service program
with *IFSIO and the QSYS one with *NOIFSIO.
Kent


-----Original Message-----
From: Elvis Budimlic [mailto:ebudimlic@xxxxxxxxxxxxxxxxxxxxxxxxx]
Sent: Monday, March 21, 2005 5:59 PM
To: 'C programming iSeries / AS400'
Subject: RE: [C400-L] DB2 UDF written in C


Good find Stephen.

I can't see a clear cut solution to using fopen for both cases.

Perhaps using precompiler defines inside your source may help.  Basically,
define a main function and two helper functions that do exactly the same
thing. Before one of them define __IFS_IO__ and then at the end of the
function #undef-ine it.
Default to IFS naming and if fopen fails for one, call function compiled
with native naming.
But that has problems doesn't it?

Elvis

-----Original Message-----
From: c400-l-bounces+ebudimlic=centerfieldtechnology.com@xxxxxxxxxxxx
[mailto:c400-l-bounces+ebudimlic=centerfieldtechnology.com@xxxxxxxxxxxx] On
Behalf Of Stephen More
Sent: Monday, March 21, 2005 3:54 PM
To: C programming iSeries / AS400
Subject: Re: [C400-L] DB2 UDF written in C

I have not gotten it to work yet, but I think I may have found the answer:

http://www-1.ibm.com/servers/enable/site/porting/iseries/overview/faq_files.
html

In ILE, when I tried fopen(), fclose(), etc. on IFS stream files in
QOpenSys they do not seem to work, but the low level calls do not have
any problems. Is there any difference in these two types of calls?

Yes. The two types of calls are different in the ILE environment. The
calls like fopen(), fclose(), fread() work on the database files
whereas low-level calls like open(), close(), read() work on the
stream files. The low level calls can work on the database files by
specifying the full qualified name (i.e. /qsys.lib/< library>.lib/<
file>.file/< mbr>.mbr). Calls like fopen(), fclose, and fread() can
also work on the stream files in QOpenSys if *IFSIO is specified for
"System Interface Option" on CRTCMOD command. Once the program is
created with *IFSIO option absolute or relative path names can be
specified with fopen(), fclose() etc calls. However, after specifying
*IFSIO these call will not work on the native database file system
even if fully qualified path name is specified.




On Fri, 18 Mar 2005 14:11:22 -0600, Elvis Budimlic
<ebudimlic@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Perhaps if you compile your module with SYSIFCOPT(*IFSIO)?
> 
> Elvis
> 
> -----Original Message-----
>  Subject: Re: [C400-L] DB2 UDF written in C
> 
> Working:
>      select debugout( 'pgmrfillib/what', 'Hello' ) from sysibm/sysdummy1
> 
> Not working:
>      select debugout( '/tmp/out.txt', 'Hello' ) from sysibm/sysdummy1
> 
> How can I get fopen to work with the IFS ?
> 
> -Steve More
> 
> _______________________________________________
> 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.
> 
>
_______________________________________________
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.





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