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



All,

More of a C question than an MI question, but...
 
I'm trying to do a read of a database source member using the read()
"UNIX-type" API. However, because OS/400 recognizes that it isn't a
'true' stream file but is a fixed-record-length file, it includes all
the trailing blanks. Since my source file contains text data, I don't
care about all the trailing blanks.
 
I can get round this by either simply reading each record in the source
file and trimming/concatenating them into a variable (my current
approach) or using the CPYTOSTMF command to copy the source member into
a 'true' stream file and then reading that. However, the multiple read
approach is time-consuming and the CPYTOSTMF isn't much faster and
involves a command-interface using QCAPCMD.

Is there any way that I can either directly access the processing which
underlies the CPYTOSTMF command (I notice that there is a called
procedure called
copy_database_file_member__FP23qp0l_stmf_description_tP22qp0l_dbf_descri
ption_tP12qlg_pathnameUsPvPV22qp0l_STMF_DBF_commarea() in one of the
service programs called by the CPYTOSTMF CPP which could be something
useful...) or somehow convince OS/400 that my database file (for the
purposes of the read() API) is actually a 'true' stream file? Is this
information that is held in the file header or is it determined by
OS/400 seeing that the file is in the QSYS file system?

Thanks in advance,

Rory


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.