[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UNIXCMD Issues



   Scott if there is another forum where I should have posted this please
   let me know.

   I have this modified version of Example7 - I just changed to a simpler
   php script.

   Here's the RPG. Note the second read UNIX etc. at the end. If I don
   not include that only the first part of the message is read i.e. It
   terminates after my name.

   FUNIX      CF   F   50        SPECIAL PGMNAME('UNIXCMD')
   F                                     PLIST(UNIXPARM) USROPN
   FQSYSPRT   O    F  132        PRINTER

   D cmd             s           5000a
   D record          ds            50

   C     UNIXPARM      PLIST
   C                   PARM                    CMD
    /free
        cmd = 'PATH=$PATH:/usr/local/Zend/Core/bin && +
              iconv -f 37 -t 819 | +
              php /www/zendcore/htdocs/testUnixCmd.php';
        open UNIX;

        record = 'Jon Paris';
        write UNIX record;
        read UNIX record;
        dsply record;
        read UNIX record;
       dsply record;
       close UNIX;

   This is the PHP script

   <?php



    $input = fgets(STDIN);

    $len = strlen($input);

    $result = "You sent ($input) It was $len characters long";

    echo $result;

   ?>

   And this the resulting display from the program. As noted above -
   unless I add the second read etc. it only shows the first part ending
   with the input data.

   DSPLY  You sent (Jon Paris
   DSPLY  ) It was 808 characters long
   I thought maybe the original input was having an end of record mark
   added causing it to be returned as two entries, so I added a hex
   convert/echo to my php but it showed the hex as being just fine with
   no extraneous bits.
   i.e 4a6f6e205061726973202020202020...
   I'm a complete Unix novice so maybe I've done something really stupid
   - if so can someone please tell me what?
   P.S. To Scott - you are not the only one who needs the iconcv() on the
   php input - I need it too or I get gibberish in the php script.

   Jon Paris
   [1]www.Partner400.com
   [2]www.SystemiDeveloper.com

References

   1. http://www.Partner400.com/
   2. http://www.SystemiDeveloper.com/
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------