Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer
    
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 Jan 18 '11 at 23:54
up vote 0 down vote accepted

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
share|improve this answer
    
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 Jun 17 '11 at 2:17
    
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 Jun 22 '11 at 1:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.