HP3000-L Archives

May 2000, Week 5

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Benji York <[log in to unmask]>
Reply To:
Date:
Wed, 31 May 2000 13:41:34 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (49 lines)
Mark Bixby wrote:
>
>...good explanation of the useful but complicated NETIPC method snipped...
>
>If box/application B is a web server, you really should consider using
Perl.
>The following when executed on box/application A will retrieve a web page
from
>box B and store it in the variable $doc:
>
>#!/PERL/PUB/perl
>use LWP::Simple;
>$doc = get('http://www.bixby.org/mark/perlix.html');
>
>Heck, even if box B is not a web server, Perl can make sockets programming
>really easy.
>
>- Mark B.

If anyone is interested, Python does a good job of this type thing too.
(BTW: Python 1.51 is available on Jazz)

Here's some Python code to get a file from a server via FTP.

from ftplib import FTP
ftp = FTP('calsonic.com', 'username', 'password')
ftp.retrbinary('RETR calsonic.zip', open('/temp/temp.zip', 'wb').write)
ftp.close()

There is an (even) simpler way (which I haven't tried) that will get a
file via ftp (or http). It uses the function urlretrieve(url, filename)
from the Python module urllib.

If you want to do your own socket clients and servers, Python offers
some high-level objects that hide all those annoying little details.

See http://www.python.org, especially the Topic Guides
(http://www.python.org/topics/) and on-line manual
(http://www.python.org/doc/current/) for more info on Python.

Python also has some good (and free) ODBC APIs available. I use
both approaches daily (ODBC with MBFoster's ODBC server on the 3k and
roll-your-own socket servers/clients) and have had good results with both.


Benji York
Information Technology Department
Calsonic North America, Inc.

ATOM RSS1 RSS2