|
On 17/03/2005, at 4:56 AM, James Rich wrote:
I wrote (well copied from someone else) a little C program that does this:
int main (int argc, char *argv[]) { FILE *infile; char buffer[LEN_BUF + 1]; int len = LEN_BUF;
infile = fopen ("/home/james/test.ps", "rb"); len = fread (buffer, sizeof (char), LEN_BUF, infile); fclose (infile); return 0; }
When I compile it with *IFSIO everything works just fine. But I need to make this part of an RPG program. So I change int main(int argc, char *argv[]) to int copy_ps_to_sf(FILE *infile), remove the FILE *infile declaration from the body of the function, and used CRTCMOD with *IFSIO. My RPG program opens the file and passes the file pointer as 10I 0. But now when this function runs I get:
read(): Operation not supported.
from perror. How can I read a file in C that I opened in RPG?
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 \ / X ASCII Ribbon campaign against HTML E-Mail / \ --------------------------------------------------------------------
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.