Author Topic: File saved via FTP always has CR/LF line ends, even on Linux system  (Read 140 times)

timur

  • Senior Community Member
  • Posts: 120
  • Hero Points: 0
I'm trying to edit a file via ftp, but every time I save the file, the line endings are converted from LF to CR/LF.  Both systems are running Linux, so this doesn't make any sense why Slickedit is adding a CR to each line end.

Can anyone tell me how to fix this?  I'm running Slickedit 2011 on Ubuntu.  I've attached an FTP log.  Why is Slickedit using ASCII mode when I've configured the FTP sessions for binary?
« Last Edit: May 05, 2017, 05:37:19 pm by timur »

timur

  • Senior Community Member
  • Posts: 120
  • Hero Points: 0
So I "fixed" it by changing these lines in _ctl_yes.on_create() from

Code: [Select]
   if( xfer_type!=FTPXFER_ASCII && xfer_type!=FTPXFER_BINARY ) {
      // Assume it's ascii since the file is opened in a text editor
      xfer_type=FTPXFER_ASCII;
   }

to

Code: [Select]
   if( xfer_type!=FTPXFER_ASCII && xfer_type!=FTPXFER_BINARY ) {
      // Assume it's ascii since the file is opened in a text editor
      xfer_type=FTPXFER_BINARY;
   }

Rodney

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 682
  • Hero Points: 43
I could not reproduce this with the latest v16.0.3.

If you have a mix of line endings in your file, then that could possibly be the reason.

You can upgrade to the latest for your version (16.0.3), or keep your hack since we will not be updating a version that old.

++rodney