Topic "Extra CR on lines in a textfile."

Author Message
Anna Krieger
[View user's profile]

Joined: 2009-10-30
Posts: 1
Location: Anna K, Sweden
When transmitting files to a remote site with WINSCP we get extra code by the end of each line. They are ordinary .txt-files and should not be affected at all. We send with ftps. When the files get to the receiver, every single row (i e record) ends with CR LF CR (or 0d0d0a). Does not matter whether we use binary, ascii or automatic transfer. Enclose command we use for transmitting:
option confirm off;option batch abort;option transfer ascii;open ftp://ZXXXSS:SSSBBYY@ftps.receiver.se:21 -certificate="certificate given but not to show" -passive -explicitssl;CD ../in;PUT %MESSAGE FIKS_A793802.TXT;CLOSE;EXIT;

We have tried to use option transfer binary and no option for transfer but the result is still the same. The file is send and received, so that is not a problem.
/Anna
Advertisements
RJM

Guest


Very curious that this reply is posted just within a couple of hours after the entry post! I'm just intending to post my problem independently and find this intitial posting...

To be precise: a few weeks ago I got a new computer. Just this week I wondered why all my Linux shell scripts (which I store in a windows environment) suddenly were "equipped" with CR characters.
Just now I have tested if winscp could have been the cause of this file content change. This is the case (a the time of computer update, I used WinSCP to copy all stuff from the old computer - instead of windows networking - I had reasons for that).

The behaviour is correct when I set WINSCP settings to have only binary transfer, not automatic - this still in contrast with Anna's experience. However, I use sftp mode and WinSCP 4.1.9 build 416.

I'd suggest the developers not to modify any file content in a next release of WinSCP *OR* to have WinSCP default set to binary mode, not automatic!

To my opinion, text mode transfer only should mean: transfer of apparently ASCII files until and no further than CTRL-Z in contrast to binary, which transfers to physical binary.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Since 4.1.1, WinSCP never modifies files during ascii/text transfer mode. So it has to be your server that does that.

Quote:
To my opinion, text mode transfer only should mean: transfer of apparently ASCII files until and no further than CTRL-Z in contrast to binary, which transfers to physical binary.

That's actually false. WinSCP should modify the files according to FTP specs. But experience is that with most servers, it is unfortunately actually better not to do that.
_________________
Martin Prikryl
RJM

Guest


Some time later... I copied a file repository on my windows machine to a Linux based svn server. This time, CR characters are removed (yes, on my new machine I forgot to change transfer mode to binary). To be sure, when I configure binary transfer mode, all files are copied exactly 1:1.

Given this information, I don't see why the problem be into the server. In fact, this does not matter. What matters is the fact that the behaviour differs from typical (FTP) File transfer behaviour. This, and this only should be a reason to have binary transfer set as default after installation of winscp.

- Rob
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License