|
Thanks Bob and Scott, I thought of the %trim() thing but still no joy. I've made the slightest progress: QzshCheckShellCommand() validated the 'ls' command (but not 'ls -l') but the QzshSystem() API still returns a "No such path or directory" message. Unfortunately I need to get this done, so I guess I'll have to try to issue the command the old fashioned way with system or QCMDEXC. The problem is that when I do that within a program the user is prompted to press Enter to close the shell. I need to make this transparent to the user, but the command doesn't appear to have a 'quiet' mode. This is really getting frustrating for something that should be simple... Joel http://www.rpgnext.com On Wed, 2003-09-03 at 13:54, Bob cozzi wrote: > Yes it does but I forgot to mention about using %TRIMR() on the variable > you're passing to the API. Give that a try. (Shooting in the dark.) > > > Bob Cozzi > Cozzi Consulting > www.rpgiv.com > > > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] > On Behalf Of Joel Cochran > Sent: Wednesday, September 03, 2003 12:11 PM > To: RPG programming on the AS400 / iSeries > Subject: Re: QzshSystem API > > I see where you are coming from but that didn't work either. Bob > mentioned using a null terminated string, but doesn't *STRING take care > of that? > > Is there another way to set the path? Maybe it is defaulting to my home > directory? > > This should be a lot easier... it surely doesn't make the IFS very > "integrated". > > Joel > http://www.rpgnext.com > > > On Wed, 2003-09-03 at 12:46, Scott Klement wrote: > > Joel, > > > > My best guess is that you don't have these commands in your path. When > > you run mkdir the QShell needs to be able to find a command called "mkdir" > > in your path in order to run it. > > > > Since you haven't actually started a QShell session, you probably haven't > > given it a path to search in -- therefore it doesn't know where to look > > for "mkdir", and so it returns "no such file or directory." (referring > > to mkdir, in other words "there is no file or directory called mkdir") > > > > If this is the case, you can solve the problem simply by typing the > > entire path of the command, like this: > > > > cmdString = '/usr/bin/mkdir ' + localDir ; > > ... > > qshErrorCode = qsh( '/usr/bin/cp -r /datacds/defs ' + localDir ); > > > > etc, etc. > > > > > > > > On Wed, 3 Sep 2003, Joel Cochran wrote: > > > > > 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 > > > > > > > > > > > > _______________________________________________ > > > This is the RPG programming on the AS400 / 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. > > > > > _______________________________________________ > > This is the RPG programming on the AS400 / 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. > > _______________________________________________ > This is the RPG programming on the AS400 / 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. > > > > > _______________________________________________ > This is the RPG programming on the AS400 / 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.
As an Amazon Associate we earn from qualifying purchases.
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.