× 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 have been through the archives and read the documentation online, but
I do not understand what is going on here... 

I'm writing an RPGIV program that needs to create a new directory in the
IFS and copy another directory into the new directory.  It goes on and
does some other things, but those will work if I can just get this down.

I'm trying to use QzshSystem to do this, but I can't get
QzshCheckShellCommand to recognize any of my commands.  Here is the
relevant code:

d qsh             pr            10i 0 extproc('QzshSystem')
d  shCommand                      *   value options( *string )

d checkShellCmd   pr            10i 0 extproc('QzshCheckShellCommand')
d  shCommand                      *   value options( *string )
d  path                           *   value options( *string )

...

 /free
   localDir = '/datacds/' + allLowerCase( inLocal );
   cmdString = 'mkdir ' + localDir ;
   if checkShellCmd( cmdString : *NULL ) = 0 ;
     qshErrorCode = qsh( cmdString );
     p_errno = getErrorPtr();
     errorMessage = %str( strerror( errno ) );
   endif ;
 /end-free

When I try it without checkShellCmd() first I get a return code of 7 and
the directory is not created.  I'm trying something similar with "cp" as
well:

 /free
   cmdString = 'cp -r /datacds/defs ' + localDir ;
   if checkShellCmd( cmdString : *NULL ) = 0 ;
     qshErrorCode = qsh( 'cp -r /datacds/defs ' + localDir );
     p_errno = getErrorPtr();
     errorMessage = %str( strerror( errno ) );
   endif ;
 /end-free

Is there some kind of QSH initialization or something I have to do
first?

Thanks,

Joel
http://www.rpgnext.com




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.