Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: "Hans Horn" Subject: Re: g77, Windows XP Professional, CALL System(Command, Status) Date: Thu, 18 Mar 2004 15:39:00 -0800 Lines: 88 Message-ID: References: X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: p1.almaden.ibm.com X-Newsreader: Microsoft Outlook Express 6.00.2800.1209 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" wrote in message news:Pine DOT GSO DOT 4 DOT 56 DOT 0403181751590 DOT 6829 AT slinky DOT cs DOT nyu DOT 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 . > > > 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 AT cs DOT nyu DOT edu > ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT 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/