Downloading text files with Python and ftplib.FTP from z/os

后端 未结 4 969
無奈伤痛
無奈伤痛 2021-01-05 18:31

I\'m trying to automate downloading of some text files from a z/os PDS, using Python and ftplib.

Since the host files are EBCDIC, I can\'t simply use FTP.retrbinary(

4条回答
  •  无人及你
    2021-01-05 19:06

    Just came across this question as I was trying to figure out how to recursively download datasets from z/OS. I've been using a simple python script for years now to download ebcdic files from the mainframe. It effectively just does this:

    def writeline(line):
        file.write(line + "\n")
    
    file = open(filename, "w")
    ftp.retrlines("retr " + filename, writeline)
    

提交回复
热议问题