Re: Python FTP binary object file upload
In 2287664539861543.wa.paulgboulderaim@listserv.ua.edu, on 06/29/2015 at 04:54 PM, Paul Gilmartin 000433f07816-dmarc-requ...@listserv.ua.edu said: This appears to be saying not that QUOTE (quotation marks in the RFC) is an FTP protocol command, That's specific to QUOTE, and doesn't restate what is sted elsewhere. Near the begining the RFC's describe the elements of FTP, and differentiate between the user interface and the command syntax; the latter being part of the protocol. While it doesn't say so, For good reasons. I take must implement to refer to the user interface and must ... support[] to refer to the network protocol. No, each refers to the network protocol, which includes the syntax of commands from the UI. -- Shmuel (Seymour J.) Metz, SysProg and JOAT ISO position; see http://patriot.net/~shmuel/resume/brief.html We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003) -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
I think the must implement does not include make it easy or make it clear or make it intuitive VBG. must implement = functionality must be there Time to find a new client. Rob Schramm On Mon, Jun 29, 2015 at 5:55 PM Paul Gilmartin 000433f07816-dmarc-requ...@listserv.ua.edu wrote: On Mon, 29 Jun 2015 16:56:43 -0400, Shmuel Metz (Seymour J.) shmuel+ibm-m...@patriot.net wrote: In 558b3731.9080...@acm.org, on 06/24/2015 at 06:03 PM, Joel Ewing jcew...@acm.org said: Strictly speaking QUOTE is not a FTP protocol command Au contraire, RFC 1123 defines it and designates it as MUST. RFC 959 has a section labelled FTP commands that defines a long list of commands as part of FTP. Thanks. I hadn't known this. Looking at RFC 1123: 4.1.4.2 QUOTE Command A User-FTP program MUST implement a QUOTE command that will pass an arbitrary character string to the server and display all resulting response messages to the user. This appears to be saying not that QUOTE (quotation marks in the RFC) is an FTP protocol command, but that it is a requirement of a conforming user inteface program. Elsewhere, it says: 4.1.2.13 Minimum Implementation; RFC-959 Section 5.1 The following commands and options MUST be supported by every server-FTP and user-FTP, except in cases where the underlying file system or operating system does not allow or support a particular command. Type: ASCII Non-print, IMAGE, LOCAL 8 Mode: Stream Structure: File, Record* Commands: USER, PASS, ACCT, PORT, PASV, TYPE, MODE, STRU, RETR, STOR, APPE, ... (no quotation marks in the RFC). While it doesn't say so, I take must implement to refer to the user interface and must ... support[] to refer to the network protocol. It leaves quit unclear how must implement affects a GUI interface such as one I encountered in which I looked for QUOTE; didn't find it; asked; and was told, Click on 'Send Host Command.' -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
On Tue, 30 Jun 2015 14:31:42 +, Rob Schramm wrote: I think the must implement does not include make it easy or make it clear or make it intuitive VBG. must implement = functionality must be there Except that to me the use of quotation marks seems to imply literal or verbatim. Looking at RFC 1123: 4.1.4.2 QUOTE Command A User-FTP program MUST implement a QUOTE command that will pass an arbitrary character string to the server and display all resulting response messages to the user. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
In 5ff04d2f82684fb49f6c4b2292008...@exmbxprd01.ad.ufl.edu, on 06/24/2015 at 10:04 PM, Nims,Alva John (Al) ajn...@ufl.edu said: So there is no Official implementation of a QUOTE type of command, What gives. you that idea? It came out 4 years after RFC 959, and is a MUST. -- Shmuel (Seymour J.) Metz, SysProg and JOAT ISO position; see http://patriot.net/~shmuel/resume/brief.html We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003) -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
In 558b3731.9080...@acm.org, on 06/24/2015 at 06:03 PM, Joel Ewing jcew...@acm.org said: Strictly speaking QUOTE is not a FTP protocol command Au contraire, RFC 1123 defines it and designates it as MUST. RFC 959 has a section labelled FTP commands that defines a long list of commands as part of FTP. -- Shmuel (Seymour J.) Metz, SysProg and JOAT ISO position; see http://patriot.net/~shmuel/resume/brief.html We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003) -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
In 6504586504821748.wa.paulgboulderaim@listserv.ua.edu, on 06/24/2015 at 03:58 PM, Paul Gilmartin 000433f07816-dmarc-requ...@listserv.ua.edu said: Well, RFC 959 mentions SITE, but not QUOTE. Well, RFC 1123 mentions QUOTE and has it as a MUST. -- Shmuel (Seymour J.) Metz, SysProg and JOAT ISO position; see http://patriot.net/~shmuel/resume/brief.html We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003) -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
On Mon, 29 Jun 2015 16:56:43 -0400, Shmuel Metz (Seymour J.) shmuel+ibm-m...@patriot.net wrote: In 558b3731.9080...@acm.org, on 06/24/2015 at 06:03 PM, Joel Ewing jcew...@acm.org said: Strictly speaking QUOTE is not a FTP protocol command Au contraire, RFC 1123 defines it and designates it as MUST. RFC 959 has a section labelled FTP commands that defines a long list of commands as part of FTP. Thanks. I hadn't known this. Looking at RFC 1123: 4.1.4.2 QUOTE Command A User-FTP program MUST implement a QUOTE command that will pass an arbitrary character string to the server and display all resulting response messages to the user. This appears to be saying not that QUOTE (quotation marks in the RFC) is an FTP protocol command, but that it is a requirement of a conforming user inteface program. Elsewhere, it says: 4.1.2.13 Minimum Implementation; RFC-959 Section 5.1 The following commands and options MUST be supported by every server-FTP and user-FTP, except in cases where the underlying file system or operating system does not allow or support a particular command. Type: ASCII Non-print, IMAGE, LOCAL 8 Mode: Stream Structure: File, Record* Commands: USER, PASS, ACCT, PORT, PASV, TYPE, MODE, STRU, RETR, STOR, APPE, ... (no quotation marks in the RFC). While it doesn't say so, I take must implement to refer to the user interface and must ... support[] to refer to the network protocol. It leaves quit unclear how must implement affects a GUI interface such as one I encountered in which I looked for QUOTE; didn't find it; asked; and was told, Click on 'Send Host Command.' -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
On 2015-06-24 16:04, Nims,Alva John (Al) wrote: You should not look at just RFC 959, unfortunately. Yes, QUOTE does not appear as a defined command in an RFC, in so far as I have been able to dig into all the FTP RFC's, but have noticed that commonly used FTP commands; PUT,GET, MPUT, MGET are also NOT defined in the RFC! Silly me! I should have thought before I wrote. Of course, the RFCs (generally) describe network protocols, not user interfaces. It is far from the province of RFC 959 to specify the operation of FileZilla or of any GUI FTP client. I did look at RFC 414 and there is just this little note: Note also that it is useful to provide a Quote or talk mode in user-FTP, to enable a user to input commands directly to the FTP server (i.e. commands not implemented in user-FTP). It is desirable that user and server FTP features and desirable modes of usage be documented and reported via the RFC mechanism. (But they can make suggestions.) What this all leads to is that you need to get a FTP SERVER command sent and as I mentioned before: FTP.sendcmd(cmd) Send a simple command string to the server and return the response string. FTP.voidcmd(cmd) Send a simple command string to the server and handle the response. Return nothing if a response code corresponding to success (codes in the range 200–299) is received. Raise error_reply otherwise. (Are these Python-peculiar?) -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
Before you read any further, did you delete the file on the MVS system before trying anything else? I believe if you send a file into an existing MVS data set, it will not change the DCB. You should not look at just RFC 959, unfortunately. Yes, QUOTE does not appear as a defined command in an RFC, in so far as I have been able to dig into all the FTP RFC's, but have noticed that commonly used FTP commands; PUT,GET, MPUT, MGET are also NOT defined in the RFC! I did look at RFC 414 and there is just this little note: Note also that it is useful to provide a Quote or talk mode in user-FTP, to enable a user to input commands directly to the FTP server (i.e. commands not implemented in user-FTP). It is desirable that user and server FTP features and desirable modes of usage be documented and reported via the RFC mechanism. So there is no Official implementation of a QUOTE type of command, a command which will send a command to the remote hosts server. Here is IBM's definition of the QUOTE command: Use the QUOte subcommand to send an uninterpreted string of data to the server port on the foreign host. The QUOte subcommand bypasses the FTP interface of your local host. You can use the QUOte subcommand to send commands that the remote server understands, but that the local host does not understand. What this all leads to is that you need to get a FTP SERVER command sent and as I mentioned before: FTP.sendcmd(cmd) Send a simple command string to the server and return the response string. FTP.voidcmd(cmd) Send a simple command string to the server and handle the response. Return nothing if a response code corresponding to success (codes in the range 200–299) is received. Raise error_reply otherwise. Al Nims Systems Admin/Programmer 3 Information Technology University of Florida (352) 273-1298 -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin Sent: Wednesday, June 24, 2015 4:59 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Python FTP binary object file upload On Wed, 24 Jun 2015 13:34:04 -0500, Janet Graff wrote: Sadly, python rejected the quote prefix for the site command. *cmd* 'QUOTE SITE RECFM=FM LRECL=80 BLKSIZE=3200' *put* 'QUOTE SITE RECFM=FM LRECL=80 BLKSIZE=3200'\r\n *get* '500 unknown command QUOTE' *resp* '500 unkown command QUOTE' Well, RFC 959 mentions SITE, but not QUOTE. And there I was about to blame it on Guido van Rossum's antipathy to EBCDIC. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
I think they are Python FTP specific, I picked them up from: https://docs.python.org/3/library/ftplib.html Al Nims Systems Admin/Programmer 3 Information Technology University of Florida (352) 273-1298 -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin Sent: Wednesday, June 24, 2015 6:15 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Python FTP binary object file upload On 2015-06-24 16:04, Nims,Alva John (Al) wrote: You should not look at just RFC 959, unfortunately. Yes, QUOTE does not appear as a defined command in an RFC, in so far as I have been able to dig into all the FTP RFC's, but have noticed that commonly used FTP commands; PUT,GET, MPUT, MGET are also NOT defined in the RFC! Silly me! I should have thought before I wrote. Of course, the RFCs (generally) describe network protocols, not user interfaces. It is far from the province of RFC 959 to specify the operation of FileZilla or of any GUI FTP client. I did look at RFC 414 and there is just this little note: Note also that it is useful to provide a Quote or talk mode in user-FTP, to enable a user to input commands directly to the FTP server (i.e. commands not implemented in user-FTP). It is desirable that user and server FTP features and desirable modes of usage be documented and reported via the RFC mechanism. (But they can make suggestions.) What this all leads to is that you need to get a FTP SERVER command sent and as I mentioned before: FTP.sendcmd(cmd) Send a simple command string to the server and return the response string. FTP.voidcmd(cmd) Send a simple command string to the server and handle the response. Return nothing if a response code corresponding to success (codes in the range 200–299) is received. Raise error_reply otherwise. (Are these Python-peculiar?) -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
On Wed, 24 Jun 2015 13:34:04 -0500, Janet Graff wrote: Sadly, python rejected the quote prefix for the site command. *cmd* 'QUOTE SITE RECFM=FM LRECL=80 BLKSIZE=3200' *put* 'QUOTE SITE RECFM=FM LRECL=80 BLKSIZE=3200'\r\n *get* '500 unknown command QUOTE' *resp* '500 unkown command QUOTE' Well, RFC 959 mentions SITE, but not QUOTE. And there I was about to blame it on Guido van Rossum's antipathy to EBCDIC. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
On 06/24/2015 03:58 PM, Paul Gilmartin wrote: On Wed, 24 Jun 2015 13:34:04 -0500, Janet Graff wrote: Sadly, python rejected the quote prefix for the site command. *cmd* 'QUOTE SITE RECFM=FM LRECL=80 BLKSIZE=3200' *put* 'QUOTE SITE RECFM=FM LRECL=80 BLKSIZE=3200'\r\n *get* '500 unknown command QUOTE' *resp* '500 unkown command QUOTE' Well, RFC 959 mentions SITE, but not QUOTE. And there I was about to blame it on Guido van Rossum's antipathy to EBCDIC. -- gil Strictly speaking QUOTE is not a FTP protocol command but rather a command to a local FTP client which by common convention sends the text following the QUOTE to the remote FTP server as a command even though its syntax can't be validated by the local client -- useful when dealing with enhanced FTP server features not supported by a particular FTP client, like conveying record-formatting SITE information to a z/OS FTP server from a non-z/OS FTP client. In the context shown, QUOTE is apparently being sent as a command to the remote FTP server, where it is indeed invalid. -- Joel C. Ewing,Bentonville, AR jcew...@acm.org -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
Janet, I don't know if this applies to your case, but I have always found that when using the ftp client from Windows to z/OS I have to use quote site and not just site to get the z/OS ftp server to set the DCB parameters (or any other z/OS ftp server variables) successfully. For example: quote site notrail ispfs quote site sbdataconn=(ibm-1047,iso8859-1) HTH Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Janet Graff Sent: Wednesday, June 24, 2015 1:58 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Python FTP binary object file upload I am using a cross compiler to produce Object files on Windows. My automation uses OOREXX to upload the files via FTP to z/OS to an object PDS. I am upgrading my automation to be run by RobotFramework using Python and I am having trouble converting the OOREXX to use the Python ftplib storbinary. The file upload properly as binary but I cannot get the blocking to work properly. The first 14 records are blocked correctly but then the following lines are off by 3 bytes. The file being uploaded is the same for the OOREXX and the python so the problem isn’t in the source dataset. My python looks like this (leaving out the error handling and the local file opening) ftp = FTP(ZOS_IPADDR, ZOS_USERID, ZOS_PASSWORD) ftp.sendcmd('SITE RECFM=FB LRECL=80 BLKSIZE=3200') ftp.storbinary('STOR '+member_name, temp_handle, 3200) The Python trace shows this (somewhat sanitized to remove userid and IP address) *cmd* 'PWD'*put* 'PWD\r\n' *get* '257 \'XXX.\' is working directory.\r\n' *resp* '257 \'XXX.\' is working directory.' *cmd* uCWD 'XXX.CUNIT.OBJECT' *put* uCWD 'XXX.CUNIT.OBJECT'\r\n *get* '250 The working directory XXX.CUNIT.OBJECT is a partitioned data set\r\n' *resp* '250 The working directory XXX.CUNIT.OBJECT is a partitioned data set' *cmd* 'SITE RECFM=FB LRECL=80 BLKSIZE=3200' *put* 'SITE RECFM=FB LRECL=80 BLKSIZE=3200\r\n' *get* '200 SITE command was accepted\r\n' *resp* '200 SITE command was accepted' *cmd* 'TYPE I' *put* 'TYPE I\r\n' *get* '200 Representation type is Image\r\n' *resp* '200 Representation type is Image' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (192,nn,nn,nn,19,248)\r\n' *resp* '227 Entering Passive Mode (192,nn,nn,nn,19,248)' *cmd* u'STOR HTODECKS' *put* u'STOR HTODECKS\r\n' *get* '125 Storing data set XXX.CUNIT.OBJECT(HTODECKS)\r\n' *resp* '125 Storing data set XXX.CUNIT.OBJECT(HTODECKS)'*get * '250 Transfer completed successfully.\r\n' *resp* '250 Transfer completed successfully.' done storing file HTODECKS *cmd* 'QUIT' *put* 'QUIT\r\n' *get* '221 Quit command received. Goodbye.\r\n' *resp* '221 Quit command received. Goodbye.' Does anyone else have experience with this? I’ve tried it with the blocking on the storbinary as 3200, 80, and default and it doesn’t see to affect the output. The DCB information for the target dataset is correct. Janet -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
Sadly, python rejected the quote prefix for the site command. *cmd* 'QUOTE SITE RECFM=FM LRECL=80 BLKSIZE=3200' *put* 'QUOTE SITE RECFM=FM LRECL=80 BLKSIZE=3200'\r\n *get* '500 unknown command QUOTE' *resp* '500 unkown command QUOTE' Janet -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
On Wed, Jun 24, 2015 at 2:23 PM, Janet Graff 004dc9e91b6d-dmarc-requ...@listserv.ua.edu wrote: John, Fantastic! That fixed the problem. I was opening the local file with 'r'. When I switched to 'rb' it was fixed. I stubbed my toes a lot with that in the C language. When I saw the same option in Python, I though it could be similar. Not too shabby for a novice Python dilettante, eh? (Texan spoofing as a Canadian) Thank you! Janet -- 3 minutes ago https://twitter.com/UnixToolTip/status/613710250571603969 Schrodinger's backup: The condition of any backup is unknown until a restore is attempted. Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be. My sister opened a computer store in Hawaii. She sells C shells down by the seashore. If someone tell you that nothing is impossible: Ask him to dribble a football. He's about as useful as a wax frying pan. 10 to the 12th power microphones = 1 Megaphone Maranatha! John McKown -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
On 6/24/2015 at 01:58 PM, Janet Graff 004dc9e91b6d-dmarc-requ...@listserv.ua.edu wrote: *cmd* 'SITE RECFM=FB LRECL=80 BLKSIZE=3200'*put* 'SITE RECFM=FB LRECL=80 BLKSIZE=3200\r\n'*get* '200 SITE command was accepted\r\n'*resp* '200 SITE command was accepted' That looks good to me. I see the TYPE I command, but not having used the z/OS FTP software in quite a while, is the TYPE BINARY also needed? Mark Post -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
John I am ftp.sendcmd('SITE RECFM=FB LRECL=80 BLKSIZE=3200') I just looked back at my original post and I apologize that the formatting is so messed up. I'll try again and see if it looks better -- My python looks like this (leaving out the error handling and the local file opening) ftp = FTP(ZOS_IPADDR, ZOS_USERID, ZOS_PASSWORD) ftp.sendcmd('SITE RECFM=FB LRECL=80 BLKSIZE=3200') ftp.storbinary('STOR '+member_name, temp_handle, 3200) The Python trace shows this (somewhat sanitized to remove userid and IP address) *cmd* 'PWD'*put* 'PWD\r\n' *get* '257 \'XXX.\' is working directory.\r\n' *resp* '257 \'XXX.\' is working directory.' *cmd* uCWD 'XXX.CUNIT.OBJECT' *put* uCWD 'XXX.CUNIT.OBJECT'\r\n *get* '250 The working directory XXX.CUNIT.OBJECT is a partitioned data set\r\n' *resp* '250 The working directory XXX.CUNIT.OBJECT is a partitioned data set *cmd* 'SITE RECFM=FB LRECL=80 BLKSIZE=3200' *put* 'SITE RECFM=FB LRECL=80 BLKSIZE=3200\r\n' *get* '200 SITE command was accepted\r\n' *resp* '200 SITE command was accepted' *cmd* 'TYPE I' *put* 'TYPE I\r\n' *get* '200 Representation type is Image\r\n' *resp* '200 Representation type is Image' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (192,nn,nn,nn,19,248)\r\n' *resp* '227 Entering Passive Mode (192,nn,nn,nn,19,248)' *cmd* u'STOR HTODECKS' *put* u'STOR HTODECKS\r\n' *get* '125 Storing data set XXX.CUNIT.OBJECT(HTODECKS)\r\n' *resp* '125 Storing data set XXX.CUNIT.OBJECT(HTODECKS)' *get* '250 Transfer completed successfully.\r\n' *resp* '250 Transfer completed successfully.' done storing file HTODECKS *cmd* 'QUIT' *put* 'QUIT\r\n' *get* '221 Quit command received. Goodbye.\r\n' *resp* '221 Quit command received. Goodbye.' The blocking on the target file is incorrect. Janet -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
Try using: FTP.sendcmd(cmd) Send a simple command string to the server and return the response string. FTP.voidcmd(cmd) Send a simple command string to the server and handle the response. Return nothing if a response code corresponding to success (codes in the range 200–299) is received. Raise error_reply otherwise. Where cmd is SITE RECFM=FM LRECL=80 BLKSIZE=3200 Al Nims Systems Admin/Programmer 3 Information Technology University of Florida (352) 273-1298 -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Janet Graff Sent: Wednesday, June 24, 2015 2:34 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Python FTP binary object file upload Sadly, python rejected the quote prefix for the site command. *cmd* 'QUOTE SITE RECFM=FM LRECL=80 BLKSIZE=3200' *put* 'QUOTE SITE RECFM=FM LRECL=80 BLKSIZE=3200'\r\n *get* '500 unknown command QUOTE' *resp* '500 unkown command QUOTE' Janet -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
TYPE I = TYPE BINARY Al Nims Systems Admin/Programmer 3 Information Technology University of Florida (352) 273-1298 -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Mark Post Sent: Wednesday, June 24, 2015 2:54 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Python FTP binary object file upload On 6/24/2015 at 01:58 PM, Janet Graff 004dc9e91b6d-dmarc-requ...@listserv.ua.edu wrote: *cmd* 'SITE RECFM=FB LRECL=80 BLKSIZE=3200'*put* 'SITE RECFM=FB LRECL=80 BLKSIZE=3200\r\n'*get* '200 SITE command was accepted\r\n'*resp* '200 SITE command was accepted' That looks good to me. I see the TYPE I command, but not having used the z/OS FTP software in quite a while, is the TYPE BINARY also needed? Mark Post -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
On Wed, Jun 24, 2015 at 1:57 PM, Janet Graff 004dc9e91b6d-dmarc-requ...@listserv.ua.edu wrote: John I am ftp.sendcmd('SITE RECFM=FB LRECL=80 BLKSIZE=3200') I just looked back at my original post and I apologize that the formatting is so messed up. I'll try again and see if it looks better -- My python looks like this (leaving out the error handling and the local file opening) ftp = FTP(ZOS_IPADDR, ZOS_USERID, ZOS_PASSWORD) ftp.sendcmd('SITE RECFM=FB LRECL=80 BLKSIZE=3200') ftp.storbinary('STOR '+member_name, temp_handle, 3200) Question: how to you open the local file to get temp_handle? Do you open it with a mode of rb to tell Python to do a binary read? The default is just r, which I think does internal processing. snip/ Janet -- 3 minutes ago https://twitter.com/UnixToolTip/status/613710250571603969 Schrodinger's backup: The condition of any backup is unknown until a restore is attempted. Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be. My sister opened a computer store in Hawaii. She sells C shells down by the seashore. If someone tell you that nothing is impossible: Ask him to dribble a football. He's about as useful as a wax frying pan. 10 to the 12th power microphones = 1 Megaphone Maranatha! John McKown -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Python FTP binary object file upload
John, Fantastic! That fixed the problem. I was opening the local file with 'r'. When I switched to 'rb' it was fixed. Thank you! Janet -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN