× 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 use the following code (adapted from Scott Kelments' examples)
// Get file handle and open file for read only
Conversion_File_Name =
%TrimR(PathName) + '/' + %TrimR(Conversion_File);
File = FOpen(%TrimR(Conversion_File_Name): 'r');
If File = *Null; // Error on file
p_ErrNo = Sys_ErrNo(); // Get Error number
ErrMsg = %Str(StrError(ErrNo)); // Load Error Message Text
Create_Exception (ErrMsg);
Return;
EndIf;

Jeff Young
Sr. Programmer Analyst

On Thu, Jan 14, 2016 at 11:09 AM, <tegger@xxxxxxxxxxx> wrote:

I had that one.

In C, you can do the following:


FILE *fdsrc;
fdsrc=fopen('/tmp/filename.ext','rb');
if fdsrc<>NULL;
fclose(fdsrc);
endif;

The problem is comparing the fdsrc to see if it is a valid handler or not.


----- Original Message -----

From: "Jan Grove Vejlstrup" <jgv@xxxxxxxx>
To: "rpg400-l" <rpg400-l@xxxxxxxxxxxx>
Sent: Thursday, January 14, 2016 10:45:55 AM
Subject: Re: RPG prototype for C-language FILE *

You can find some of the prototypes from Scott Klement here:

http://www.agnethe.dk/mcpressonline/likesoundex/source/bufio_h.txt

Best regards

Jan



Am 14.01.2016 um 16:24 schrieb tegger@xxxxxxxxxxx:
I have that document.
The trouble is not being able to open a file in a binary mode using the
open() function. I know that I can open a file in binary mode with the
fopen. The CL commands to copy files around the IFS is way too slow. When
the routines copy a PDF file, they garbage the output file. Most text files
are fine, but some get gummed up too.



----- Original Message -----

From: "Luis Rodriguez" <luisro58@xxxxxxxxx>
To: "RPG programming on the IBM i (AS/400 and iSeries)" <
rpg400-l@xxxxxxxxxxxx>
Sent: Thursday, January 14, 2016 9:33:14 AM
Subject: Re: RPG prototype for C-language FILE *

Jay,

Scott Klement has posted in his web site some very easy to use examples
about accessing the IFS with RPGLE. Check the following URL:

http://scottklement.com/rpg/ifs.html

In fact, check the whole site :-) Scott has some wonderful routines and
code examples....

HTH,

Luis

Luis Rodriguez


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.