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

James Rich

It's not the software that's free; it's you.
        - billyskank on Groklaw

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.