FTP Windows AS/400

T

Tim G.

I am trying to execute a win python script that connects to an AS/400;
changes from the native lib to the IFS file system; then, changes to a
directory in IFS; gets a file.

Any help would be greatly appreciated.

I cannot get the script to switch from native to IFS. I get the
following error:

Traceback (most recent call last):
File "C:\Python24\Tools\scripts\ftp400.py", line 9, 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.

here is the script:

import ftplib, os

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

ftp = ftplib.FTP('server', 'user', 'password')
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()
 
B

Brendan Bispham

Hi Tim,
I cannot get the script to switch from native to IFS.

Yes you can...
Traceback (most recent call last):
File "C:\Python24\Tools\scripts\ftp400.py", line 9, in ?
ftp.cwd(path)

It's the cwd which is having a problem
here is the script:

import ftplib, os

filename=''
path = "directory"

Change the path to an absolute path, eg:'250 "/home" is current directory.'

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top