473,385 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

FTP Error: Windows AS/400

I am trying to use Win Python to ftp files from an AS/400 IFS directory
down to my Windows machine.

I seem to get stuck when I am trying to send a command to the AS/400 to
switch file systems from native to IFS and then to issue a cd to my
folder. I get the error below.

If anyone has had experience trying to ftp from a 400, I would greatly
appreciate any info on the topic.
Code:

import ftplib, os

filename=''
path = "jde7333"
os.chdir('c:\\ftp_jde400')

ftp = ftplib.FTP('test400')
ftp.login('oneworld', 'onew0r1d')
#ftp.sendcmd('quote site namefmt 1')
ftp.sendcmd('site namefmt 1')
ftp.cwd(path)
#remotefiles = ftp.nlst()
#ftp.retrlines('LIST')
#for filename in remotefiles:
# file = open(filename, 'wb')
# ftp.retrbinary('RETR ' + filename, file.write, 1024)
# file.close()

ftp.quit()
Error:

Traceback (most recent call last):
File "C:\Python24\Tools\scripts\ftp400.py", line 10, in ?
ftp.cwd(path)
File "C:\Python24\lib\ftplib.py", line 494, in cwd
return self.voidcmd(cmd)
File "C:\Python24\lib\ftplib.py", line 246, in voidcmd
return self.voidresp()
File "C:\Python24\lib\ftplib.py", line 221, in voidresp
resp = self.getresp()
File "C:\Python24\lib\ftplib.py", line 214, in getresp
raise error_perm, resp
ftplib.error_perm: 501 Unknown extension in database file name.

Sep 13 '05 #1
1 4428
I've used DOS FTP to hit AS/400 systems before and usually have to completely
qualify the file name or ensure that I'm in the correct directory. When you use
command-line FTP to get the file, do these commands mimic your commands?

What version of python are you using?

If you issue PWD on the FTP site, what is returned when you're in the correct
folder? Can you use the sendcmd() function to mimic the functionality of cwd()
for this purpose?

I don't have easy access to an AS/400 with which to test, but maybe there's an
idea or two here that's worth trying.

-Pete

"Tim G." <tg********@yahoo.com> wrote:
I am trying to use Win Python to ftp files from an AS/400 IFS directory
down to my Windows machine.

I seem to get stuck when I am trying to send a command to the AS/400 to
switch file systems from native to IFS and then to issue a cd to my
folder. I get the error below.

If anyone has had experience trying to ftp from a 400, I would greatly
appreciate any info on the topic.
Code:

import ftplib, os

filename=''
path = "jde7333"
os.chdir('c:\\ftp_jde400')

ftp = ftplib.FTP('test400')
ftp.login('oneworld', 'onew0r1d')
#ftp.sendcmd('quote site namefmt 1')
ftp.sendcmd('site namefmt 1')
ftp.cwd(path)
#remotefiles = ftp.nlst()
#ftp.retrlines('LIST')
#for filename in remotefiles:
# file = open(filename, 'wb')
# ftp.retrbinary('RETR ' + filename, file.write, 1024)
# file.close()

ftp.quit()
Error:

Traceback (most recent call last):
File "C:\Python24\Tools\scripts\ftp400.py", line 10, in ?
ftp.cwd(path)
File "C:\Python24\lib\ftplib.py", line 494, in cwd
return self.voidcmd(cmd)
File "C:\Python24\lib\ftplib.py", line 246, in voidcmd
return self.voidresp()
File "C:\Python24\lib\ftplib.py", line 221, in voidresp
resp = self.getresp()
File "C:\Python24\lib\ftplib.py", line 214, in getresp
raise error_perm, resp
ftplib.error_perm: 501 Unknown extension in database file name.

Sep 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: B Golash | last post by:
Hi I`m trying to install a third-party control. During the install I receive this error...see the url below. I have no idea as to the meaning of the error. ...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
9
by: JTrigger | last post by:
When I compile my project using the IDE on a development machine it works just fine. When I compile it on the server using csc.exe, I get the following error when I try to bring it up in the web...
0
by: Jie | last post by:
Does anyone know why I keep having the following error. I have to rebuild the solution every time I run it in design mode. thanks jie Server Error in '/ReapPortal' Application....
4
by: james margey | last post by:
Hi to all, I have spent 3 days at this error and i have two days to go for a deadline, and i am about to go off my nut, the reason being: Microsoft dont seem to be able to provide a solution, I...
1
by: Carlos Kim via DotNetMonster.com | last post by:
Compiler Error Message: CS1026: ) expected Source Error: Line 12: <body MS_POSITIONING="GridLayout"> Line 13: <form id="Form1" method="post" runat="server"> Line 14:...
1
by: abh1508 | last post by:
Following a release of code the following problem occurs on certain asp ..net pages. This is not a problem on other testing/demo environments. IIS seems to be creating certain files twice in the...
1
by: Bruce | last post by:
We suddenly got a mysterious error message on our Windows Server 2003 (SP1) after rolling out a bug fix on a web services application this morning. The application compiles and runs fine on the...
21
by: Mark Rae | last post by:
Hi, I have an ASP.NET 2 web application (not web site) project and am using a web deployment project to deploy to the testing, then the production server. All has been working well for months...
0
by: .nLL | last post by:
Erorr is --------------------- Microsoft VBScript runtime error '800a0046' Permission denied /a.asp, line 3 -----------------------
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.