does not work on freeBSD but works on linux, and windows

John fabiani jfabiani at yolo.com
Tue Jun 29 21:34:53 EDT 2004


Hi,
this is a little strange. All I'm trying to do is ftp a 'dbf' file - but 
the file is corrupt after the transfer.

1. the freeBSD 4.4 is a couple of years old using:

Python 2.1.1 (#1, Sep 13 2001, 18:12:15)
[GCC 2.95.3 20010315 (release) [FreeBSD]] on freebsd4
Type "copyright", "credits" or "license" for more information.

2.  below is a simple ftp program

import ftplib
import sys
remote=ftplib.FTP(host='myIpAddress',user='username',passwd='password')
mohpac07=open("/usr/home/spx/servplus/outbounds/mohpac07.dbf",'rb')
remote.set_debuglevel(2)
remote.set_pasv(0)
remote.storbinary("STOR mohpac07.dbf",mohpac07,8192)
remote.close
remote.quit

3. below is the output.

*cmd* 'TYPE I'
*put* 'TYPE I\r\n'
*get* '200 Switching to Binary mode.\r\n'
*resp* '200 Switching to Binary mode.'
*cmd* 'PORT 190,10,10,2,14,194'
*put* 'PORT 190,10,10,2,14,194\r\n'
*get* '200 PORT command successful. Consider using PASV.\r\n'
*resp* '200 PORT command successful. Consider using PASV.'
*cmd* 'STOR mohpac07.dbf'
*put* 'STOR mohpac07.dbf\r\n'
*get* '150 Ok to send data.\r\n'
*resp* '150 Ok to send data.'
*get* '226 File receive OK.\r\n'
*resp* '226 File receive OK.'


I then test the dbf file by attemping to open the file with foxpro and 
the file is corrupt (not a table).  The strange thing the same code 
works from XP, and Linux (both are python 2.3).  I don't know much about 
freeBSD and I'm not sure if I can install 2.3.

Anybody no why this is happening?

TIA
John



More information about the Python-list mailing list