|
Prev: FYI/OT: [Fwd: ANN: Units of measurement for Ada v2.7]
Next: FYI/OT: [Fwd: ANN: Units of measurement for Ada v2.7]
From: feenberg on 3 Jul 2008 01:50 On Jul 2, 10:27 pm, Brian Salter-Duke <b_d...(a)bigpond.net.invalid> wrote: > On Wed, 2 Jul 2008 10:22:23 -0700 (PDT), feenberg <feenb...(a)gmail.com> wrote: > > I have been working on converting a local fortran 77 program to run as > > a cgi program under the Apache webserver on our FreeBSD machine. No > > perl and no special libraries are required to do what we need, and the > > fortran code is compact and straightforward. I have posted some > > explanation and examples at: > > > http://www.nber.org/sys-admin/fortran-cgi > > > The trick is to use the POST method with MIME type multi-part/form- > > data so that form data is separated from header information and can be > > read with either free or fixed fortran reads. > > > Any comments much appreciated. > > > Daniel Feenberg > > feenberg at nber dot org > > I have been using a fortran library by L. Chiappetta from around 1999. > It makes converting a fortran program to be a cgi program quite easy, > but I forget where I got it from. Try google. > > -- > Brian Salter-Duke Melbourne, Australia > My real address is b_duke(AT)bigpond(DOT)net(DOT)au > Use this for reply or followup Searching for "chiappetta fortran cgi" doesn't bring up any plausible hits. Can you suggest any other search terms? Daniel Feenberg
From: feenberg on 3 Jul 2008 01:58 On Jul 2, 6:47 pm, user1 <u...(a)example.net> wrote: > feenberg wrote: > > I have been working on converting a local fortran 77 program to run as > > a cgi program under the Apache webserver on our FreeBSD machine. No > > perl and no special libraries are required to do what we need, and the > > fortran code is compact and straightforward. I have posted some > > explanation and examples at: > > > http://www.nber.org/sys-admin/fortran-cgi > > > The trick is to use the POST method with MIME type multi-part/form- > > data so that form data is separated from header information and can be > > read with either free or fixed fortran reads. > > > Any comments much appreciated. > > > Daniel Feenberg > > feenberg at nber dot org > > I presume you have looked into the cgi-src folder contained in the old > NCSA HTTPd distribution ? The utilities they have are written in C. Not > fortran, but perhaps useful examples to translate or build on. These are available at http://hoohoo.ncsa.uiuc.edu/cgi/examples.html but require a function to obtain environment variables that is not part of standard fortran 77. Furthermore, parsing the string in the enviroment variable would be painful in f77 without the use of the free format reads, which are possible only with the POST method. Daniel Feenberg Daniel Feenberg
From: Brian Salter-Duke on 3 Jul 2008 04:24 On Wed, 2 Jul 2008 22:50:27 -0700 (PDT), feenberg <feenberg(a)gmail.com> wrote: > On Jul 2, 10:27 pm, Brian Salter-Duke <b_d...(a)bigpond.net.invalid> > wrote: >> On Wed, 2 Jul 2008 10:22:23 -0700 (PDT), feenberg <feenb...(a)gmail.com> wrote: >> > I have been working on converting a local fortran 77 program to run as >> > a cgi program under the Apache webserver on our FreeBSD machine. No >> > perl and no special libraries are required to do what we need, and the >> > fortran code is compact and straightforward. I have posted some >> > explanation and examples at: >> >> > http://www.nber.org/sys-admin/fortran-cgi >> >> > The trick is to use the POST method with MIME type multi-part/form- >> > data so that form data is separated from header information and can be >> > read with either free or fixed fortran reads. >> >> > Any comments much appreciated. >> >> > Daniel Feenberg >> > feenberg at nber dot org >> >> I have been using a fortran library by L. Chiappetta from around 1999. >> It makes converting a fortran program to be a cgi program quite easy, >> but I forget where I got it from. Try google. >> >> -- >> Brian Salter-Duke Melbourne, Australia >> My real address is b_duke(AT)bigpond(DOT)net(DOT)au >> Use this for reply or followup > > > > Searching for "chiappetta fortran cgi" doesn't bring up any plausible > hits. Can you suggest any other search terms? No, sorry. I have a good look but can not find it. The guy is Lucio Chiappetta and I found a web link for him in my old emails, but it no longer works. It is a long while since I used thsi library from scratch, but I do have one web page that uses the library. I can not even find the documentation. I did find:- http://krabulator.free.fr/devel/cgi77.html which at first glance looks similar. Sorry I can not help more. I could e-mail you a tar ball of the fortran routines needed for the library. Email me if you want it. Brian. > Daniel Feenberg -- Brian Salter-Duke Melbourne, Australia My real address is b_duke(AT)bigpond(DOT)net(DOT)au Use this for reply or followup
From: user1 on 3 Jul 2008 10:20 feenberg wrote: > On Jul 2, 6:47 pm, user1 <u...(a)example.net> wrote: >> feenberg wrote: >>> I have been working on converting a local fortran 77 program to run as >>> a cgi program under the Apache webserver on our FreeBSD machine. No >>> perl and no special libraries are required to do what we need, and the >>> fortran code is compact and straightforward. I have posted some >>> explanation and examples at: >>> http://www.nber.org/sys-admin/fortran-cgi >>> The trick is to use the POST method with MIME type multi-part/form- >>> data so that form data is separated from header information and can be >>> read with either free or fixed fortran reads. >>> Any comments much appreciated. >>> Daniel Feenberg >>> feenberg at nber dot org >> I presume you have looked into the cgi-src folder contained in the old >> NCSA HTTPd distribution ? The utilities they have are written in C. Not >> fortran, but perhaps useful examples to translate or build on. > > These are available at http://hoohoo.ncsa.uiuc.edu/cgi/examples.html > but require a function to obtain environment variables that is not > part of standard fortran 77. > Furthermore, parsing the string in the enviroment variable would be > painful in f77 without the use of the free format reads, which are > possible only with the POST method. > > Daniel Feenberg > > Daniel Feenberg Use internal reads to parse strings for "=", "&" or other characters in Fortran, note their location, and extract appropriate substrings. I'm not sure how to "unescape" a URI encoded string in fortran. I must say, I don't understand why you want to do this completely with "standard fortran 77", unless you are interested in building some sort of educational toy of limited use. (nothing wrong with that, actually) Environment variables are important to CGI.
From: user1 on 3 Jul 2008 10:55
feenberg wrote: > On Jul 2, 6:47 pm, user1 <u...(a)example.net> wrote: >> feenberg wrote: >>> I have been working on converting a local fortran 77 program to run as >>> a cgi program under the Apache webserver on our FreeBSD machine. No >>> perl and no special libraries are required to do what we need, and the >>> fortran code is compact and straightforward. I have posted some >>> explanation and examples at: >>> http://www.nber.org/sys-admin/fortran-cgi >>> The trick is to use the POST method with MIME type multi-part/form- >>> data so that form data is separated from header information and can be >>> read with either free or fixed fortran reads. >>> Any comments much appreciated. >>> Daniel Feenberg >>> feenberg at nber dot org >> I presume you have looked into the cgi-src folder contained in the old >> NCSA HTTPd distribution ? The utilities they have are written in C. Not >> fortran, but perhaps useful examples to translate or build on. > > These are available at http://hoohoo.ncsa.uiuc.edu/cgi/examples.html > but require a function to obtain environment variables that is not > part of standard fortran 77. > Furthermore, parsing the string in the enviroment variable would be > painful in f77 without the use of the free format reads, which are > possible only with the POST method. > > Daniel Feenberg > > Daniel Feenberg Disregard last note, mentioning an internal read, which may not be needed or helpful. Locating and extracting substrings between "=" ,"&", and other characters seems straightforward enough. I would still have to work at "unescaping" a URI encoded string in f77, not sure how I would proceed. I must ask why you prefer not to pre-process the environment and form data with shell scripts or perl scripts, and then pass control along to a fortran program |