How to fix Windows new line character on SFTP synchronization in Eclipse (pdt)

0

I have a problem with Windows new line characters being introduced into text files on Eclipse SFTP synchronization (via JCraft's SFTP plugin).

I've set "New text file line delimiter" to Unix and have even sanitized the file with "fromdos" but every time I upload using the SFTP plugin, Windows new line characters can be seen in the remote file as "^M" characters (when viewed in vi).

A point to note is that if I upload using an external SFTP client, it's all fine.

Eclipse Version: PDT (Helios)
SFTP: jcraft sftp plugin
Local Environment: Ubuntu 10.04
Remote Environments: FreeBSD 6.4, Debian 4.0

What am I missing?

denormalizer

Posted 2011-01-18T00:40:49.070

Reputation: 501

Answers

0

The only workaround I’ve found (which is usable but not entirely satisfactory) is if I add the following:

/Preferences/Team/File Content/
 * Name/Extension: *.php
 * Content: Binary

denormalizer

Posted 2011-01-18T00:40:49.070

Reputation: 501

The side effect of this hack is a missing line feed at EOF resulting in the following error if viewed in vim: [Incomplete last line] – denormalizer – 2011-06-17T02:17:33.437

This issue has now been confirmed with the author of the eclipse sftp plugin. ymnk: "If we have an opportunity to enhance that plug-in, that functionality may be hacked." – denormalizer – 2011-06-22T01:21:14.790

0

This is a behavior of the JCraft plugin. You should probably contact JCraft support about it, but you might try adding the line.separator property to your <eclipse_dir>\configuration\config.ini and setting it to LF.

heavyd

Posted 2011-01-18T00:40:49.070

Reputation: 54 755

Thanks for your response. Adding that extra line in config.ini didn't seem to work. I'll need to investigate more... maybe it's not the jcraft after all... I'll keep you posted – denormalizer – 2011-01-18T23:54:27.263