Windows CLI SFTP ?

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
LIonel_Dyck
Posts: 11
Joined: Thu Jun 25, 2020 9:18 am

Windows CLI SFTP ?

Post by LIonel_Dyck »

Using the Windows sftp command, either the native windows sftp or the windows/linux sftp, is there a way to instruct it to do a text mode transfer?

For example - my command: sftp me@111.11.11.111://'userid.pds(member)' member.txt

This always results in a binary download which is the sftp default. Is there an option that will enable text mode transfers?
coz
Posts: 391
Joined: Fri Jul 30, 2004 5:29 pm

Re: Windows CLI SFTP ?

Post by coz »

You will want to send a "mode=text" option request to the Co:Z sftp-server. As you've discovered, mode=binary is the default.

To do this from the OpenSSH client on linux or Windows, you would do this:

Code: Select all

$ sftp me@111.11.11.111
sftp> ls /+mode=text
/+mode=text   
sftp> get //userid.pds(member) member.txt
You can look at the options in effect by issuing the ls /+ command by itself:

Code: Select all

sftp> ls /+
/+/clientcp=ISO8859-1  /+/error.log           /+/gdgnt               /+/loglevel=F          /+/mode=text           /+/servercp=IBM-1047   
/+/trim
From this listing you can see that you can easily specify the code pages used for text mode translation. This section of the user's guide:
https://dovetail.com/docs/sftp/using.html#using_opts describes setting the options from the client. This section describes all of the options available: https://dovetail.com/docs/sftp/options.html
Post Reply