Hi folks,

Using Unicon 11.1 beta

I'm trying to convert a large application to work under windows. It's been 
running very effectively under various *NIX and *NUX for a long time.

The problem lies around the use of

    pfd := open("command line", "pr")

which I'm using to invoke another Unicon program named wacro.bat as per the 
usual output of icont on windows.

Before I describe my real problem, I think I spot a defect in

        src/runtime/rsys.r

around about line 1213 in the definition of popen() for Windows.

    /* Look for the application name */
    for (p = cmd; *p && isspace(*p); p++);
    if (*p == '"') {
      q = ++p;
      while(*p && *p != '"') p++;
->>   if (*p != '\0') {
        fprintf(stderr, "popen: malformed command (\" not terminated)\n");
        return NULL;
      }
    }
    else

as marked with ->> - shouldn't that say

    if(*p != '"')
or
    if(*p == '\0')

I tried wrapping my first command line word with double-quotes, and it did 
indeed fail, although I didn't see the error message.

Now, onto the real problem:

The image() of my command argument to open( , "pr") is

"wacro.bat -I c:\\devel\\master\\all.4gm\\lib1.4gs
-I c:\\Progra~1\\WacGen\\lib-trunk\\include
\"AUDIT=1\" \"STAGE_RELEASE=6.0\" \"NEW_MAIN=1\" \"GENERO=2.10\" 
\"ROWID_RET=1\" \"FORMCOLORS=none\" \"ORACLE=1\" \"ROWID_TYPE=integer\"
\"MSV=1\" \"ROWID_GET=1\" \"STAGE_CLASS=auth\" \"APP_NAME=Authority\"
\"TOOLS=4.11\" \"MAP_MAIN=1\" \"APP_CLASS=auth\" \"MAP_4GL=1\"
\"ROWID_CHK=1\" \"FOURJAYS=2.10\" \"APP_RELEASE=6.0\" \"ROWID_PK=1\"
\"ODI_4JS=1\" -f ..\\i_al001.4gs\\sal001a.trg"

or as a pure unescaped string I guess that comes out as;

wacro.bat -I c:\devel\master\all.4gm\lib1.4gs
-I c:\Progra~1\WacGen\lib-trunk\include
"AUDIT=1" "STAGE_RELEASE=6.0" "NEW_MAIN=1" "GENERO=2.10" "ROWID_RET=1"
"FORMCOLORS=none" "ORACLE=1" "ROWID_TYPE=integer" "MSV=1" "ROWID_GET=1"
"STAGE_CLASS=auth" "APP_NAME=Authority" "TOOLS=4.11" "MAP_MAIN=1"
"APP_CLASS=auth" "MAP_4GL=1" "ROWID_CHK=1" "FOURJAYS=2.10"
"APP_RELEASE=6.0" "ROWID_PK=1" "ODI_4JS=1"
-f ..\i_al001.4gs\sal001a.trg

The process appears to be starting up, but it is not feeding any lines back 
up the pipe, and I cannot see any output from simple traces like

    write(&errout, "Here's WACRO!")

At the point it's hanging, I see two iconx processes, two cmd processes, and 
the perl process that wraps the whole shebang

    perl
      cmd
        iconx generator
          cmd
            iconx wacro

I can't (at this stage) see the command line arguments to the cmd and iconx 
processes but I'm hunting down a utility that might show me. Since the 
output of &errout is not reaching the console either, I've just made wacro 
write it's command line arguments to a file and then close it to ensure 
it's flushed. The contents come out as:

WACRO HERE!
  -I
  c:\devel\master\all.4gm\lib1.4gs
  -I
  c:\Progra~1\WacGen\lib-trunk\include
  AUDIT=1
  STAGE_RELEASE=6.0
  NEW_MAIN=1
  GENERO=2.10
  ROWID_RET=1

which is about 210 bytes all-up.

It's looking like 255 might be the magic limit, and the balance is being 
consumed by %CMDSPEC% /c path-to-wacro.bat (with or without the %CMDSPEC%)

The rest of the code in rsys.r proceeds with arcane windows system calls 
that I'm clueless about.

Can anyone share any hard facts about my limits, and maybe any work-arounds 
that might grow the legal command line of my CMD ?

If not I'll have to muck around with tempfiles, which I don't like because 
they tend to hang around at the slightest opportunity...



------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to