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



Hi Emannuel,
 
It is really important that you get your flags right.
 
In Pr_SetFile you set oflag (open flags) to:
 
Oflag = O_CREAT + O_CODEPAGE + O_RDWR + O_TRUNC;
 
This isn't right, it will CREATE(O_CREAT) a new file, or empty an existing
file (O_TRUNC), and may not be what you want when trying to read a file. :-)
 
You then open the file at this point.
 
You then attempt to open the file again in Pr_OpnFile, but this time you set
oflag to:
 
Oflag = O_WRONLY + O_TEXTDATA;

 
This is also incorrect, if you're going to read the file, because you've
opened it for WRITE ONLY (O_WRONLY).
 
Basically, it looks like you've copied the code for writing to a file, and
you're now attempting to use it for reading. This wont work because the
flags are not right.
 
As a first stab - I'd get rid of the second open completely and remove
O_CREAT and O_TRUNC from the first open.
 
Try it then and see what you get.
 
Alternatively, look here:
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/apis/apifin
der.htm for the open API to get a complete list of flags and modes.
 
I'm not at work at the moment, but I'll post the complete code you need in
the morning, if nobody else picks this up.
 
Cheers
 
Larry Ducie

 
 

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.