gnucobol-users
[Top][All Lists]
Advanced

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

[open-cobol-list] Calling a system function in Open Cobol.


From: Roger While
Subject: [open-cobol-list] Calling a system function in Open Cobol.
Date: Mon, 26 Jun 2006 12:07:12 +0200

Works fine here (0.33 tarball)
Also works under Cygwin and MSYS/MinGW.
Here's the genned code (no special OC options) -
  {
    {
      int (*func)();
      cob_call_params = 1;
      func = cob_resolve_1 ("system");
      (*(int *) (b_2)) = func ((unsigned char *)"ls -l");
    }
 And here it is with -static option -
  {
    {
      cob_call_params = 1;
      (*(int *) (b_2)) = system ((unsigned char *)"ls -l");
    }
  }

Looks fine to me  :-)

Roger



In other COBOL compilers on a *nix system it is possible to
 execute a system call like this:
        CALL "system" USING "ls -l".

 On Open Cobol this code compiles clean and executes but the system
 function "ls -l"  does not appear to work.

 Any hints?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]