I doubt my reply is very helpful, probably mostly redundant, for what
has already been offered by others. Comments inline:
On 10 Oct 2013 14:07, Gary Thompson wrote:
Our V7R1 system does not yet have the required QZIPUTIL
service program nor QSYSINC header files.
The /yet/ being the key part of that comment. Of course "These new
APIs are included in the latest level of the HTTP Server Group PTF -
SF99368" according to the Announcement link provided in the iProDevloper
link. So that should be easily-enough resolved.?
_APIs by Example: Zip and Unzip Files with the New 7.1 Zip API Support_
Dec. 8, 2011 Carsten Flensburg
System iNetwork Programming Tips Newsletter
http://iprodeveloper.com/rpg-programming/apis-example-zip-and-unzip-files-new-71-zip-api-support
However, I still lean to using the API thinking error handling
may be better ?
But of course /better/ is relative; as compared to what, is the
obvious response. Regardless, I consider my zip\unzip activity to be a
binary effect; i.e. either it works or it doesn't, with little thought
about what might go wrong, until or if ever. I suppose that is a side
effect of never having had any issues in the past. Other issues like
/file not found/ errors are IMO very typically unhelpful in *nix-like
environments, so using your own program from which good problem
descriptions and recovery text could be offered to the user, in contrast
with the utilities from Qshell or similar interface, might just be the
/better/ effect alluded in that question.?
I have no experience [thus no] recommendation about what of the
available choices might be a better choice [with regard to error
handling, or otherwise], within some unknown parameters. But my prior
response, irrespective all that, just points out the indirect nature of
using a call to the QCMDEXC API [which is itself a CL command
shell\interpreter] from within an RPG program just to invoke the QSH CL
command in order to issue a Qshell command-request that then invokes the
Qshell shell\interpreter *if* one were merely utilizing something like
the _ajar_ shell request; i.e. a more direct route [by avoiding the CL
command shell\interpreter] could be used to send the Qshell request
directly to the Qshell shell\interpreter from an RPG program.
We have several production uses of Qp0lProcessSubtree (thanks
to Scott Klement) and these programs are reliable and easy
to copy and adapt to other uses, so my thought is the QZIPUTIL
may be a similar learning/development curve ?
I expect that using the newest "QzipZip()--Compress Files and
Directories" API should be sufficiently like the other "Integrated File
System APIs". Mostly because that list includes the aforementioned
"QlgProcessSubtree()--Process a Path Name (using NLS-enabled path name)"
API:
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/apis/unix2.htm
(and we have the iProDeveloper article and code from Carsten
Flensburg)
Then also having available, the link to the IBM announcement:
http://www.ibm.com/common/ssi/cgi-bin/ssialias?infotype=AN&subtype=CA&htmlfid=897/ENUS211-411&appname=USN
_i IBM i 7.1 enhancements optimize ISV support i_
IBM United States Software Announcement 211-411; October 12, 2011
"...
_Application development enhancements_
Native archive and un-archive API support
IBM i supports the user's ability to both create (.zip) archive files
and extract the contents of (.zip) archive files. This support includes
native APIs and a service program to create (.zip) archive files, and
the ability to extract the contents of (.zip) archive files. Multiple
files and directories within IBM i can be compressed and packaged into a
single archive file using the QzipZip API. Using the QzipUnzip API, the
contents of the (.zip) archive file can be extracted to the target IBM i
system. The service program QZIPUTIL has entry points that can be called
by any other ILE program to create and extract (.zip) archive files. It
is a system state user domain service program that adopts *USER
authority. The service program has the following exported functions -
QzipZip and QzipUnzip. The zip and unzip implementation on IBM i uses
the open source zlib library to inflate and deflate the files. These new
APIs are included in the latest level of the HTTP Server Group PTF -
SF99368.
..."
As an Amazon Associate we earn from qualifying purchases.