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




I have just started writing a program that uses C funtions to write to the
IFS. I have read where the IFS has a limit of 2 GB unless you specify Large
File type.

Do you really mean "C functions"? i.e. do you mean that you're using fopen(), fgets(), fwrite(), fputs() etc?

Or do you mean the Unix-type APIs, open(), read(), write(), etc? These APIs are not what I would call "C APIs", since they're system APIs, not part of the ILE C runtime.

Could someone supply me with an example of how this looks in the RPGLE program.

If you're using open() and friends, all you need to do is pass O_LARGEFILE as one of the open flags.

There's also an open64() API, but all it does is add O_LARGEFILE to the list of flags you've spefificed, and then call open() for you. So, there's really no reason to use it except that you can change your ExtProc() to ExtProc('open64') and have all your programs automatically gain large file support if you recompile them.

There's are fopen64() for large files if you're using the actual C APIs, though support for that is newer than support for open64() and friends. I believe (though I could be wrong) that fopen()'s large file support didn't start til V5R3.

The other thing you should consider is that even though the API may support files this large, that doesn't mean that the underlying file system necessarily does.

For example, in V5R3, QDLS's limit is 2gb, The "root" and QOpenSys file systems can do up to 1TB. /QNTC is limited to 4gb, etc. So even though the APIs can take 64bit values (allowing 16 exabytes!) the underlying filesystem has much smaller capacity.

Leif Guldbrand has handy links to the system limits on his web site:
http://www.think400.dk/downloads.htm
(Look for OS/400 max capacities and limits)

Just something to think about.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.