Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple CGI web server in Python on VMS

Tags:

python

cgi

vms

I am trying to run an extremely simple CGI server on VMS done in python.

import sys    
from BaseHTTPServer import HTTPServer
from CGIHTTPServer import CGIHTTPRequestHandler    
server_address=('',8080)
httpd = HTTPServer(server_address, CGIHTTPRequestHandler)
httpd.serve_forever()

The problem I have is that it serves out static content properly and it tries to execute the CGI-s (it is in the right place, and Ihave used those CGIs with Apache so that part is definitely not the issue) but it hangs somewhere. It is something I don't know about VMS.

Any pointer to the right direction would be appreciated. :)

Update: Simplified, I need to execute a program on VMS and get the results of that program somehow. Any reference to executing subprocesses and getting their results is enough for me.

like image 224
McKracken Avatar asked May 03 '11 01:05

McKracken


1 Answers

Are you using the Python port from http://hg.vmspython.org/vmspython/ ?

If so, I think this thread, and this file (which appears to implement a form of popen2), may hold the keys to your salvation. There appear to be VMS-specific modules (at least vms.starlet, vms.rtl.lib, vms.dvidef, vms.clidef) in the port that provide interfaces to such things as VMS's spawn function. Documentation seems to be spotty or nonexistent, however.

like image 177
Nicholas Knight Avatar answered Oct 17 '22 00:10

Nicholas Knight