sftp client - standard output, filename getting truncated


Author
Message
emalinis
emalinis
Forum Guru (61 reputation)Forum Guru (61 reputation)Forum Guru (61 reputation)Forum Guru (61 reputation)Forum Guru (61 reputation)Forum Guru (61 reputation)Forum Guru (61 reputation)Forum Guru (61 reputation)Forum Guru (61 reputation)
Group: Forum Members
Posts: 7, Visits: 17
Hi, we are currently using the sftp.exe client to transfer files to an sFTP server. We invoke this process using PowerShell's 'Start-Process' cmdlet in order to redirect the standard output (stdout) to a file with the '-RedirectStandardOutput' option of Start-Process. For example (in PowerShell console)..

> Start-Process -PassThru -Wait -NoNewWindow -Filepath "sftp.exe" -ArgumentList "..our_sftp_connection_and_batch_parameters.." -RedirectStandardOutput "drive:\path_to_file\sftpStdOut.log"

The above all works fine and the file transfers complete as expected. In the sftpStdOut.log file, what we see during the transmission are lines (for example) such as the following...
:
filename_and_ext_of_file_being_transferred 73% 896KB 122.0KB/s 00:02 ETA
filename_and_ext_of_file_being_transferred 83% 1024KB 122.6KB/s 00:01 ETA
filename_and_ext_of_file_being_transferred 91% 1120KB 120.0KB/s 00:00 ETA
filename_and_ext_of_file_being_transferred 99% 1216KB 117.6KB/s 00:00 ETA
filename_and_ext_of_file_being_transferred 100% 1226KB 94.3KB/s 00:13
:

We also tail the above stdout file to monitor the progress of the file transfers, as well as giving us metrics of how the sFTP transmission went.

The issue:
In the above stdout logging, the "filename_and_ext_of_file_being_transferred" appears to be limited to only the left-most *45* characters. If the filename/ext of the file being transmitted happens to be >45 chars, then the right-most characters of the filename is *truncated*. And unfortunately, we do have filenames that we transmit which are longer than 45 chars.

Note that the issue should be similar, if not identical, even if the standard output of sftp.exe was just going to the CMD console (at least we have no reason to believe the filenames wouldn't be truncated there as well).

So.. how can we get the stdout logging above being done by the sftp.exe client to display >45 chars, or ideally the *full* filename and extension regardless of how long it might be?

We have fully-licensed copy of Pragma software. "About Pragma FortressCL" dialog window displays our installed version as: "Version: 5.0 Build 9 Revision 2904".

Thanx in advance!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search