Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

My little brother got this fortune: nohup rm -fr /& So he did...


devel / comp.lang.fortran / Re: Is it possible to call a Command Procedure in fortran?

SubjectAuthor
* Is it possible to call a Command Procedure in fortran?HCorte
+* Re: Is it possible to call a Command Procedure in fortran?gah4
|`* Re: Is it possible to call a Command Procedure in fortran?David Duffy
| `* Re: Is it possible to call a Command Procedure in fortran?gah4
|  `* Re: Is it possible to call a Command Procedure in fortran?John
|   `* Re: Is it possible to call a Command Procedure in fortran?John
|    `- Re: Is it possible to call a Command Procedure in fortran?John
+* Re: Is it possible to call a Command Procedure in fortran?Louis Krupp
|`* Re: Is it possible to call a Command Procedure in fortran?HCorte
| `- Re: Is it possible to call a Command Procedure in fortran?HCorte
`* Re: Is it possible to call a Command Procedure in fortran?JCampbell
 `* Re: Is it possible to call a Command Procedure in fortran?Dick Hendrickson
  `- Re: Is it possible to call a Command Procedure in fortran?abrsvc

1
Is it possible to call a Command Procedure in fortran?

<9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1216&group=comp.lang.fortran#1216

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:1009:: with SMTP id z9mr202044qkj.483.1630510737663;
Wed, 01 Sep 2021 08:38:57 -0700 (PDT)
X-Received: by 2002:a25:2a0f:: with SMTP id q15mr98006ybq.283.1630510737454;
Wed, 01 Sep 2021 08:38:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 1 Sep 2021 08:38:57 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8a0:6702:ab00:e386:3a2a:2569:5e20;
posting-account=HDxk_QoAAABHOnxohqRjEL16UDUgop5K
NNTP-Posting-Host: 2001:8a0:6702:ab00:e386:3a2a:2569:5e20
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
Subject: Is it possible to call a Command Procedure in fortran?
From: hmmbcorte@gmail.com (HCorte)
Injection-Date: Wed, 01 Sep 2021 15:38:57 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 0
 by: HCorte - Wed, 1 Sep 2021 15:38 UTC

Is it possible to call a command procedure in fortran? and if so obtain a variable/symbol of the command procedure.

Re: Is it possible to call a Command Procedure in fortran?

<767d1eb1-3ef5-420e-b990-6e128ac92ff3n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1217&group=comp.lang.fortran#1217

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a37:989:: with SMTP id 131mr30811qkj.472.1630532769031;
Wed, 01 Sep 2021 14:46:09 -0700 (PDT)
X-Received: by 2002:a25:4408:: with SMTP id r8mr28755yba.13.1630532768380;
Wed, 01 Sep 2021 14:46:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 1 Sep 2021 14:46:08 -0700 (PDT)
In-Reply-To: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:a00b:d69a:273:e36d;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:a00b:d69a:273:e36d
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <767d1eb1-3ef5-420e-b990-6e128ac92ff3n@googlegroups.com>
Subject: Re: Is it possible to call a Command Procedure in fortran?
From: gah4@u.washington.edu (gah4)
Injection-Date: Wed, 01 Sep 2021 21:46:09 +0000
Content-Type: text/plain; charset="UTF-8"
 by: gah4 - Wed, 1 Sep 2021 21:46 UTC

On Wednesday, September 1, 2021 at 8:38:58 AM UTC-7, HCorte wrote:
> Is it possible to call a command procedure in fortran? and if so obtain a variable/symbol of the command procedure.

There is EXECUTE_COMMAND_LINE which will execute anything that is normally executable.

In the usual implementation on unix-like systems it calls sh to run the program,
and on windows it calls CMD.EXE to run it. Unix rule is that programs run by a shell can't
change environment variables in the host shell. There are funny tricks used by programs
that do need to do that.

As well as I know it, CMD doesn't have that restriction when running CMD files.
(Traditionally CMD and BAT files work the same way.)
However, EXECUTE_COMMAND_LINE itself doesn't have a way to get variables back.
You could write a CMD file that would then run the one you want, and pass back any
variables in an appropriate way.

Re: Is it possible to call a Command Procedure in fortran?

<sgp3p0$54h$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1218&group=comp.lang.fortran#1218

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!/QwItrhN7O9peV8xMcpmzA.user.46.165.242.75.POSTED!not-for-mail
From: davidD@qimr.edu.au (David Duffy)
Newsgroups: comp.lang.fortran
Subject: Re: Is it possible to call a Command Procedure in fortran?
Date: Wed, 1 Sep 2021 23:53:06 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <sgp3p0$54h$1@gioia.aioe.org>
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com> <767d1eb1-3ef5-420e-b990-6e128ac92ff3n@googlegroups.com>
Injection-Info: gioia.aioe.org; logging-data="5265"; posting-host="/QwItrhN7O9peV8xMcpmzA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: tin/2.4.4-20191224 ("Millburn") (Linux/5.4.0-81-generic (x86_64))
X-Notice: Filtered by postfilter v. 0.9.2
 by: David Duffy - Wed, 1 Sep 2021 23:53 UTC

gah4 <gah4@u.washington.edu> wrote:
> On Wednesday, September 1, 2021 at 8:38:58 AM UTC-7, HCorte wrote:
>> Is it possible to call a command procedure in fortran? and if so obtain a variable/symbol of the command procedure.
>
> There is EXECUTE_COMMAND_LINE which will execute anything that is normally executable.
>
Most generally, you will have to then capture the output of the command to a file, and
read that back in. You can using C interop to directly access such
commands, but this is going to be system specific.o
Cheers, David Duffy.

Re: Is it possible to call a Command Procedure in fortran?

<92a7be1a-fa6a-4d7d-9c7e-2fd0d5290961n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1219&group=comp.lang.fortran#1219

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:c23:: with SMTP id a3mr576633qvd.34.1630541066662;
Wed, 01 Sep 2021 17:04:26 -0700 (PDT)
X-Received: by 2002:a25:1c45:: with SMTP id c66mr687408ybc.361.1630541066495;
Wed, 01 Sep 2021 17:04:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 1 Sep 2021 17:04:26 -0700 (PDT)
In-Reply-To: <sgp3p0$54h$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:a00b:d69a:273:e36d;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:a00b:d69a:273:e36d
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
<767d1eb1-3ef5-420e-b990-6e128ac92ff3n@googlegroups.com> <sgp3p0$54h$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <92a7be1a-fa6a-4d7d-9c7e-2fd0d5290961n@googlegroups.com>
Subject: Re: Is it possible to call a Command Procedure in fortran?
From: gah4@u.washington.edu (gah4)
Injection-Date: Thu, 02 Sep 2021 00:04:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2049
 by: gah4 - Thu, 2 Sep 2021 00:04 UTC

On Wednesday, September 1, 2021 at 4:53:09 PM UTC-7, David Duffy wrote:

(snip)

> Most generally, you will have to then capture the output of the command to a file, and
> read that back in. You can using C interop to directly access such
> commands, but this is going to be system specific.o
> Cheers, David Duffy.

Well if you are doing that, might as well call popen().
(But yes, it will still be system specific.)

Though it would be better to have a real Fortran equivalent to popen().

In the Fortran 77 days, with HP-UX, I did manage to use popen().
HP-UX Fortran (at least used to) have a way to connect a Unix file
descriptor to a Fortran unit. I had a program do the popen() and then
return the fd, for the Fortran program to use. That was so I could
spool directly to lpr.

Re: Is it possible to call a Command Procedure in fortran?

<e91a5583-f161-4ca6-9bba-52e6f0f7c6dfn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1220&group=comp.lang.fortran#1220

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:724c:: with SMTP id l12mr613606qtp.131.1630544893216;
Wed, 01 Sep 2021 18:08:13 -0700 (PDT)
X-Received: by 2002:a25:38ce:: with SMTP id f197mr940210yba.254.1630544893053;
Wed, 01 Sep 2021 18:08:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 1 Sep 2021 18:08:12 -0700 (PDT)
In-Reply-To: <92a7be1a-fa6a-4d7d-9c7e-2fd0d5290961n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:546:300:4c20:8985:7b7:fd0a:9156;
posting-account=7tVJUQoAAACymEG6aShD5R0lhHCm_A0r
NNTP-Posting-Host: 2601:546:300:4c20:8985:7b7:fd0a:9156
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
<767d1eb1-3ef5-420e-b990-6e128ac92ff3n@googlegroups.com> <sgp3p0$54h$1@gioia.aioe.org>
<92a7be1a-fa6a-4d7d-9c7e-2fd0d5290961n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e91a5583-f161-4ca6-9bba-52e6f0f7c6dfn@googlegroups.com>
Subject: Re: Is it possible to call a Command Procedure in fortran?
From: urbanjost@comcast.net (John)
Injection-Date: Thu, 02 Sep 2021 01:08:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: John - Thu, 2 Sep 2021 01:08 UTC

On Wednesday, September 1, 2021 at 8:04:27 PM UTC-4, gah4 wrote:
> On Wednesday, September 1, 2021 at 4:53:09 PM UTC-7, David Duffy wrote:
>
> (snip)
> > Most generally, you will have to then capture the output of the command to a file, and
> > read that back in. You can using C interop to directly access such
> > commands, but this is going to be system specific.o
> > Cheers, David Duffy.
> Well if you are doing that, might as well call popen().
> (But yes, it will still be system specific.)
>
> Though it would be better to have a real Fortran equivalent to popen().
>
> In the Fortran 77 days, with HP-UX, I did manage to use popen().
> HP-UX Fortran (at least used to) have a way to connect a Unix file
> descriptor to a Fortran unit. I had a program do the popen() and then
> return the fd, for the Fortran program to use. That was so I could
> spool directly to lpr.
As mentioned, you can execute a system command:
https://urbanjost.github.io/M_intrinsics/execute_command_line.3fortran.html
and if you are on a POSIX system this should work for calling popen and returning the
output into a character array
https://github.com/urbanjost/M_process
or can be used as an example on how to do that. That would not work on MSWIndows unless you were in CygWin or WSL (WIndows Subsystem for Linux) or something else that provided a POSIX interface. I think modern MSWIndows might have a procedure called _popen that is similar, but not all that familiar with it. It is more portable to call execute_command_line(3f) and write data into a file, as explained above but if you are a POSIX/Unix/GNU Linux user the popen(3c) interface is very versatile and easy to use via an interface like M_process(3f). I didn't really get from the post just what kind of information you wanted to get back into the program.

Re: Is it possible to call a Command Procedure in fortran?

<e3399f98-bebb-4f9e-bcb2-eb602d0bd6f7n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1221&group=comp.lang.fortran#1221

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ad4:4e0f:: with SMTP id dl15mr834778qvb.60.1630545543271; Wed, 01 Sep 2021 18:19:03 -0700 (PDT)
X-Received: by 2002:a05:6902:100e:: with SMTP id w14mr1043555ybt.239.1630545543074; Wed, 01 Sep 2021 18:19:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 1 Sep 2021 18:19:02 -0700 (PDT)
In-Reply-To: <e91a5583-f161-4ca6-9bba-52e6f0f7c6dfn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:546:300:4c20:8985:7b7:fd0a:9156; posting-account=7tVJUQoAAACymEG6aShD5R0lhHCm_A0r
NNTP-Posting-Host: 2601:546:300:4c20:8985:7b7:fd0a:9156
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com> <767d1eb1-3ef5-420e-b990-6e128ac92ff3n@googlegroups.com> <sgp3p0$54h$1@gioia.aioe.org> <92a7be1a-fa6a-4d7d-9c7e-2fd0d5290961n@googlegroups.com> <e91a5583-f161-4ca6-9bba-52e6f0f7c6dfn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e3399f98-bebb-4f9e-bcb2-eb602d0bd6f7n@googlegroups.com>
Subject: Re: Is it possible to call a Command Procedure in fortran?
From: urbanjost@comcast.net (John)
Injection-Date: Thu, 02 Sep 2021 01:19:03 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 7
 by: John - Thu, 2 Sep 2021 01:19 UTC

PS: An often-overlooked way to get data back into your Fortran program from a system command is to have the system command write a NAMELIST file, which can then be read with a single READ from your program, which can eliminate having to parse the character output from the POPEN interface used by something like M_process. That is another reason to call a command via EXECUTE_COMMAND_LINE(3f) and read the data back in, as the READ statement can do the type conversions too if your command writes something easy to read.

Re: Is it possible to call a Command Procedure in fortran?

<1cf0a7e8-a706-40ac-b29b-7c4ed3269eacn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1222&group=comp.lang.fortran#1222

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:fbcf:: with SMTP id n15mr876615qvp.49.1630547041220;
Wed, 01 Sep 2021 18:44:01 -0700 (PDT)
X-Received: by 2002:a25:188b:: with SMTP id 133mr1095516yby.80.1630547041038;
Wed, 01 Sep 2021 18:44:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 1 Sep 2021 18:44:00 -0700 (PDT)
In-Reply-To: <e3399f98-bebb-4f9e-bcb2-eb602d0bd6f7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:546:300:4c20:8985:7b7:fd0a:9156;
posting-account=7tVJUQoAAACymEG6aShD5R0lhHCm_A0r
NNTP-Posting-Host: 2601:546:300:4c20:8985:7b7:fd0a:9156
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
<767d1eb1-3ef5-420e-b990-6e128ac92ff3n@googlegroups.com> <sgp3p0$54h$1@gioia.aioe.org>
<92a7be1a-fa6a-4d7d-9c7e-2fd0d5290961n@googlegroups.com> <e91a5583-f161-4ca6-9bba-52e6f0f7c6dfn@googlegroups.com>
<e3399f98-bebb-4f9e-bcb2-eb602d0bd6f7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1cf0a7e8-a706-40ac-b29b-7c4ed3269eacn@googlegroups.com>
Subject: Re: Is it possible to call a Command Procedure in fortran?
From: urbanjost@comcast.net (John)
Injection-Date: Thu, 02 Sep 2021 01:44:01 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2790
 by: John - Thu, 2 Sep 2021 01:44 UTC

program getstuff
! put the values you want to get back in a namelist
! like the date and hostname in this example
character(len=80) :: date ;namelist /systemstuff/ date
character(len=80) :: host ;namelist /systemstuff/ host
integer :: lun
! assumes a POSIX system with the sh|bash command
! call a system command that writes a little NAMELIST group
call execute_command_line('echo "&SYSTEMSTUFF DATE=''`date`'', HOST=''`hostname`'' /"> junko')
! read the NAMELIST file and delete it
open(newunit=lun,file='junko') ! should generate a more unique name and check IOSTAT and such
read(lun,nml=systemstuff)
! now back to normal Fortran
write(*,*)'The date is ',trim(date)
write(*,*)'The hostname is ',trim(host)
close(lun,status='delete')
end program getstuff

works with at least three compilers on a Linux system

ifort x..f90
./a.out
The date is Wed 01 Sep 2021 09:34:23 PM EDT
The hostname is venus

nvfortran x..f90
./a.out
The date is Wed 01 Sep 2021 09:34:33 PM EDT
The hostname is venus

gfortran x..f90
./a.out
The date is Wed 01 Sep 2021 09:34:45 PM EDT
The hostname is venus

Re: Is it possible to call a Command Procedure in fortran?

<EZXXI.17700$F26.7219@fx44.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1223&group=comp.lang.fortran#1223

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!news.uzoreto.com!peer02.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx44.iad.POSTED!not-for-mail
Subject: Re: Is it possible to call a Command Procedure in fortran?
Newsgroups: comp.lang.fortran
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
From: lkrupp@invalid.pssw.com.invalid (Louis Krupp)
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-US
Lines: 5
Message-ID: <EZXXI.17700$F26.7219@fx44.iad>
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Thu, 02 Sep 2021 03:58:28 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Wed, 1 Sep 2021 21:58:28 -0600
X-Received-Bytes: 1145
 by: Louis Krupp - Thu, 2 Sep 2021 03:58 UTC

On 9/1/2021 9:38 AM, HCorte wrote:
> Is it possible to call a command procedure in fortran? and if so obtain a variable/symbol of the command procedure.
Are you by any chance using OpenVMS?

Louis

Re: Is it possible to call a Command Procedure in fortran?

<70042da8-ce92-4272-afe0-196ef5319a9cn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1224&group=comp.lang.fortran#1224

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:fbcf:: with SMTP id n15mr2441231qvp.49.1630578556288;
Thu, 02 Sep 2021 03:29:16 -0700 (PDT)
X-Received: by 2002:a25:6507:: with SMTP id z7mr3427935ybb.439.1630578556081;
Thu, 02 Sep 2021 03:29:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Thu, 2 Sep 2021 03:29:15 -0700 (PDT)
In-Reply-To: <EZXXI.17700$F26.7219@fx44.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=81.193.21.144; posting-account=HDxk_QoAAABHOnxohqRjEL16UDUgop5K
NNTP-Posting-Host: 81.193.21.144
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com> <EZXXI.17700$F26.7219@fx44.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <70042da8-ce92-4272-afe0-196ef5319a9cn@googlegroups.com>
Subject: Re: Is it possible to call a Command Procedure in fortran?
From: hmmbcorte@gmail.com (HCorte)
Injection-Date: Thu, 02 Sep 2021 10:29:16 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: HCorte - Thu, 2 Sep 2021 10:29 UTC

A quinta-feira, 2 de setembro de 2021 à(s) 04:58:31 UTC+1, Louis Krupp escreveu:
> On 9/1/2021 9:38 AM, HCorte wrote:
> > Is it possible to call a command procedure in fortran? and if so obtain a variable/symbol of the command procedure.
> Are you by any chance using OpenVMS?
>
> Louis

Yes Louis using OpenVMS sorry didn't provide the OS before, is EXECUTE_COMMAND_LINE specific to Unix,Linux or does it also work in OpenVMS?

Re: Is it possible to call a Command Procedure in fortran?

<0e7d98b5-946c-4e49-a10e-80a2c70cbbf9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1226&group=comp.lang.fortran#1226

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:5417:: with SMTP id b23mr2455246qtq.140.1630581470447;
Thu, 02 Sep 2021 04:17:50 -0700 (PDT)
X-Received: by 2002:a05:6902:705:: with SMTP id k5mr3654217ybt.517.1630581470161;
Thu, 02 Sep 2021 04:17:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Thu, 2 Sep 2021 04:17:49 -0700 (PDT)
In-Reply-To: <70042da8-ce92-4272-afe0-196ef5319a9cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=81.193.21.144; posting-account=HDxk_QoAAABHOnxohqRjEL16UDUgop5K
NNTP-Posting-Host: 81.193.21.144
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
<EZXXI.17700$F26.7219@fx44.iad> <70042da8-ce92-4272-afe0-196ef5319a9cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0e7d98b5-946c-4e49-a10e-80a2c70cbbf9n@googlegroups.com>
Subject: Re: Is it possible to call a Command Procedure in fortran?
From: hmmbcorte@gmail.com (HCorte)
Injection-Date: Thu, 02 Sep 2021 11:17:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: HCorte - Thu, 2 Sep 2021 11:17 UTC

A quinta-feira, 2 de setembro de 2021 à(s) 11:29:17 UTC+1, HCorte escreveu:
> A quinta-feira, 2 de setembro de 2021 à(s) 04:58:31 UTC+1, Louis Krupp escreveu:
> > On 9/1/2021 9:38 AM, HCorte wrote:
> > > Is it possible to call a command procedure in fortran? and if so obtain a variable/symbol of the command procedure.
> > Are you by any chance using OpenVMS?
> >
> > Louis
> Yes Louis using OpenVMS sorry didn't provide the OS before, is EXECUTE_COMMAND_LINE specific to Unix,Linux or does it also work in OpenVMS?

$ FORTRAN /VERSION
HP Fortran V8.2-104939-50H96

$ SHOW SYSTEM
OpenVMS V8.4

Re: Is it possible to call a Command Procedure in fortran?

<0cb5ea86-2108-4789-8f6a-849a0c0a4a03n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1228&group=comp.lang.fortran#1228

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:4156:: with SMTP id e22mr1429112qtm.308.1630632659229;
Thu, 02 Sep 2021 18:30:59 -0700 (PDT)
X-Received: by 2002:a25:644:: with SMTP id 65mr1695881ybg.300.1630632659006;
Thu, 02 Sep 2021 18:30:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Thu, 2 Sep 2021 18:30:58 -0700 (PDT)
In-Reply-To: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:8003:2328:5a00:110b:9cd:aae4:6741;
posting-account=W6x0LgoAAADUV-yz4YE9o_6nxcvZvCmc
NNTP-Posting-Host: 2001:8003:2328:5a00:110b:9cd:aae4:6741
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0cb5ea86-2108-4789-8f6a-849a0c0a4a03n@googlegroups.com>
Subject: Re: Is it possible to call a Command Procedure in fortran?
From: campbelljohnd01@gmail.com (JCampbell)
Injection-Date: Fri, 03 Sep 2021 01:30:59 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 5
 by: JCampbell - Fri, 3 Sep 2021 01:30 UTC

On Thursday, September 2, 2021 at 1:38:58 AM UTC+10, HCorte wrote:
> Is it possible to call a command procedure in fortran? and if so obtain a variable/symbol of the command procedure.
If you are recovering information from the external procedure, isn't the important part of the question how to execute an external procedure then wait for it to complete before proceeding?

You need to know when the results of the "command procedure" are available before proceeding.
This can be the messy part, such as testing for a file to be created, unless this is an option in EXECUTE_COMMAND_LINE ?

Re: Is it possible to call a Command Procedure in fortran?

<ipeuthFk0tnU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1230&group=comp.lang.fortran#1230

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: dick.hendrickson@att.net (Dick Hendrickson)
Newsgroups: comp.lang.fortran
Subject: Re: Is it possible to call a Command Procedure in fortran?
Date: Fri, 3 Sep 2021 10:56:32 -0500
Lines: 11
Message-ID: <ipeuthFk0tnU1@mid.individual.net>
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
<0cb5ea86-2108-4789-8f6a-849a0c0a4a03n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net sGPJ7BSMuvcl/DtjdCbOcQjPGU3Pb1wdUubPGHUtEn1CpCgAtn
Cancel-Lock: sha1:tpHenJnD4s91ib6u48lVXCUeRCc=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.12.0
In-Reply-To: <0cb5ea86-2108-4789-8f6a-849a0c0a4a03n@googlegroups.com>
Content-Language: en-US
 by: Dick Hendrickson - Fri, 3 Sep 2021 15:56 UTC

On 9/2/21 8:30 PM, JCampbell wrote:
> On Thursday, September 2, 2021 at 1:38:58 AM UTC+10, HCorte wrote:
>> Is it possible to call a command procedure in fortran? and if so obtain a variable/symbol of the command procedure.
> If you are recovering information from the external procedure, isn't the important part of the question how to execute an external procedure then wait for it to complete before proceeding?
>
> You need to know when the results of the "command procedure" are available before proceeding.
> This can be the messy part, such as testing for a file to be created, unless this is an option in EXECUTE_COMMAND_LINE ?
>
There is a WAIT option and some status arguments.

Dick Hendrickson

Re: Is it possible to call a Command Procedure in fortran?

<4a1c42de-49fe-495a-9800-ab61299a41a1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1254&group=comp.lang.fortran#1254

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:4744:: with SMTP id k4mr1812906qtp.247.1631360608847;
Sat, 11 Sep 2021 04:43:28 -0700 (PDT)
X-Received: by 2002:a25:7350:: with SMTP id o77mr3095926ybc.549.1631360608704;
Sat, 11 Sep 2021 04:43:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sat, 11 Sep 2021 04:43:28 -0700 (PDT)
In-Reply-To: <ipeuthFk0tnU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=96.230.211.194; posting-account=Ysq9BAoAAACGX1EcMMPkdNg4YcTg0TxG
NNTP-Posting-Host: 96.230.211.194
References: <9f4b3476-1a65-4c2a-a924-eab83d17c21dn@googlegroups.com>
<0cb5ea86-2108-4789-8f6a-849a0c0a4a03n@googlegroups.com> <ipeuthFk0tnU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4a1c42de-49fe-495a-9800-ab61299a41a1n@googlegroups.com>
Subject: Re: Is it possible to call a Command Procedure in fortran?
From: dansabrservices@yahoo.com (abrsvc)
Injection-Date: Sat, 11 Sep 2021 11:43:28 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: abrsvc - Sat, 11 Sep 2021 11:43 UTC

On Friday, September 3, 2021 at 11:56:36 AM UTC-4, Dick Hendrickson wrote:
> On 9/2/21 8:30 PM, JCampbell wrote:
> > On Thursday, September 2, 2021 at 1:38:58 AM UTC+10, HCorte wrote:
> >> Is it possible to call a command procedure in fortran? and if so obtain a variable/symbol of the command procedure.
> > If you are recovering information from the external procedure, isn't the important part of the question how to execute an external procedure then wait for it to complete before proceeding?
> >
> > You need to know when the results of the "command procedure" are available before proceeding.
> > This can be the messy part, such as testing for a file to be created, unless this is an option in EXECUTE_COMMAND_LINE ?
> >
> There is a WAIT option and some status arguments.
>
> Dick Hendrickson

When using an OpenVMS system, there is a library call: LIB$DO_COMMAND that can be used to execute command procedures.

Dan


devel / comp.lang.fortran / Re: Is it possible to call a Command Procedure in fortran?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor