g77, Windows XP Professional, CALL System(Command, Status)

Hans Horn hannes@2horns.com
Fri Mar 19 06:41:00 GMT 2004


Lars,

the (system-dependent) fortran system call has only one argument on the
fortran side,
a character string (character*(*) string), which does have an upper limit in
length.

for instance, try this one:

c------------------------------------
      program tester
      call systest1() ! calls system() as subroutine
      call systest2() ! calls system() as function
      end
      subroutine systest1()
      call system('ls -l')
      end
      subroutine systest2()
      integer irc, system
      irc = system('pwd')
      write(*,*) 'irc=',irc
      irc = system('kiss my butt')
      write(*,*) 'irc=',irc
      end
c------------------------------------

tested & works on both, AIX and cygwin/winxp.

Hans

"Igor Pechtchanski" <pechtcha@cs.nyu.edu> wrote in message
news:Pine.GSO.4.56.0403181751590.6829@slinky.cs.nyu.edu...
> On Thu, 18 Mar 2004, Lars Steinke wrote:
>
> > Hello,
> >
> > I have a problem with:
> >
> >       CALL System(Command, Status)
> >
> > I am using g77 (cygwin, Windows XP Professional).
> > The routine call system does not work - nothing happens, no
> > error-message, the program continues and the call system command seems
> > to be ignored.
> >
> > Can you help me?
>
> Please provide the exact steps needed to reproduce this problem (i.e., a
> complete small testcase, the exact compilation command line, or, better
> yet, a Makefile).  Also, we need information on what packages are
> installed on your system, and what your environment contains -- both will
> be present in the output of "cygcheck -svr", which you should have
> attached to your message anyway, as per <http://cygwin.com/problems.html>.
>
> > BTW: What is system(3)?
> >
http://gcc.gnu.org/onlinedocs/g77/System-Intrinsic--subroutine-.html#System%20Intrinsic%20(subroutine):
> > "...
> > Description:
> >
> > Passes the command Command to a shell
> >
> > (see system(3)).
> >
> > If argument Status is present, it contains the value returned by
> > system(3), presumably 0 if the shell command succeeded. Note that which
> > shell is used to invoke the command is system-dependent and environment-
> > dependent.
> >
> > .."
> >
> > Thanks, Lars
>
> It means "the man page for 'system' in section 3 of the manual".  Try "man
> -s 3 system" (normally, "man system" should do this anyway).
> Igor
> -- 
> http://cs.nyu.edu/~pechtcha/
>       |\      _,,,---,,_ pechtcha@cs.nyu.edu
> ZZZzz /,`.-'`'    -.  ;-;;,_ igor@watson.ibm.com
>      |,4-  ) )-,_. ,\ (  `'-' Igor Pechtchanski, Ph.D.
>     '---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!
>
> "I have since come to realize that being between your mentor and his route
> to the bathroom is a major career booster."  -- Patrick Naughton
>




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list