|
I am not looking for "low level" file IO, but high level! Eg: Declare the file, use the file. Like in RPG. To do Native database IO in ILE/C this is what you have to do: // Below "Declares the file". Equivilent to an "F" spec in RPG #pragma mapinc("xfimghp", "*libl/xfimghp(*all)", \ "both key lvlchk", "d") #include "xfimghp" _RFILE *imghpf; /* XFIMGHP */ _RIOFB_T *imghpfbk; // The below "Opens the file". Equivilent to "OPEN XFIMGHP" in RPG imghpf = _Ropen("*libl/xfimghp", "rr, arrseq=N, blkrcd=Y"); if (imghpf == NULL) { printf("Error opening XFIMGHP - %s\n", XlateErrorNo(tBuf, errno)); return; } // Below are the actual record buffers. RPG "I" spec FAXLIB_XFIMGHP_XFIMGHR_both_t imghp; FAXLIB_XFIMGHP_XFIMGHR_key_t imghpKey; // Below does a "Chain" // cpystrchar converts "C" style string (null terminated) to AS/400 fixed length char buffer cpystrchar(imghpKey.IMNAME, hgi->ImageName, sizeof(imghpKey.IMNAME)); imghpfbk = _Rreadk(imghpf, &imghp, sizeof(imghp), __KEY_EQ | __NO_LOCK, &imghpKey, sizeof(imghpKey)); if (imghpfbk->num_bytes != sizeof(imghp)) ImgNotFoundFlag = TRUE; // Record not found (probably) None of the above is rocket science, but it sure is a pain where the sun don't shine! Bob -----Original Message----- From: Joel Fritz [SMTP:JFritz@sharperimage.com] Sent: Tuesday, May 11, 1999 5:20 PM To: 'MIDRANGE-L@midrange.com' Subject: RE: X-Spec (was: "RPG isn't cool") Not a bad idea. How many out there think that low level file io in C is as easy as RPG? How about stream file io? -----Original Message----- From: Bob Crothers [mailto:bob@cstoneindy.com] Sent: Tuesday, May 11, 1999 9:45 AM To: 'MIDRANGE-L@midrange.com' Subject: RE: X-Spec (was: "RPG isn't cool") Instead of making RPG more like C, how about making C more like RPG? Before everybody starts throwing flaming emails, stop and think about it. What is the best part of RPG? The Database IO. In RPG, it So easy to use and very effective. What is the bad part of RPG? The fixed form and highly structured stuff. Short names. Etc. What is the good part of "C"? Highly flexible, free form, multiple data types, and stuff like that. What RPG is bad at. What is the bad part of "C"? Database! The database support, well it sucks. Hard to use...hard to manage...and harder to figure out! But, the rest of "C" is very good. And, it is not hard for an RPG programmer to learn C. Then you don't have to worry about "breaking" RPG. And to give descent Database to C, you only have to add some functions. Just a thought...I'll go back into lurk mode. Bob +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midr ange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
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.