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


  • Subject: Re: RE: To read a text file directly
  • From: "Scott Klement" <infosys@xxxxxxxxxxxx>
  • Date: 25 Oct 1999 10:06:55 -0500

Hmmmm...

This may sound strange, but I find that I don't need to bind to
QC2LE in order to use the IFS or Sockets API.  The "Unix-type"
API's appear to be in the default RPG binding directory.

Granted, I end up binding to QC2LE in order to access the errno,
and strerror functions...

I'm at V3R2.  Is this also true on newer releases of OS/400?



Buck Calabro <mcalabro@commsoft.net> wrote:
>
> Vishal,
> If you mean IFS files, then you can use the C functions open(),
>  close(),
> fstat() and read().  They are in binding directory QC2LE.  Here are
>  some
> prototypes:
>
> Dopen             pr            10i 0 extproc('open')
> D                                 *   value
> D                               10i 0 value
> D                               10u 0 value options(*nopass)
> D                               10u 0 value options(*nopass)
>
> Dread             pr            10i 0 extproc('read')
> D                               10i 0 value
> D                                 *   value
> D                               10u 0 value
>
> Dfstat            pr            10i 0 extproc('fstat')
> D                               10i 0 value
> D                                 *   value
>
> Dclose            pr            10i 0 extproc('close')
> D                               10i 0 value
>
> Look at the Unix-type APIs book for details.
>
> Buck Calabro
>
> > -----Original Message-----
> > From: Vishal Gupta
> > Sent: Monday, October 25, 1999 5:06 AM
> > To: RPG400-L@midrange.com
> > Subject: To read a text file directly
> >
> > Hi,
> >
> > I want to know that is there any way in ILE RPG to read a text fil
> > directly.
> >
> > What i have done is that i have made a PF with one field and then
>  copying
> > the full text file in that PF and using it in my program.
> > The number of lines in that text file becomes the number of record
>  in the
> >
> > PF.This way it works fine.
> >
> > Is there any direct way to read and write to a text file instead o
> > converting it to PF.
> >
> > Can any one help me.
> >
> > Thanks,
> > Vishal.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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 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.