Author Topic: Synch always moving a certain file  (Read 3652 times)

BarryWood

  • Jr. Member
  • **
  • Posts: 10
Synch always moving a certain file
« on: December 04, 2007, 12:26:16 AM »
The synchronization feature has been working well for but I've run into a situation where there is one file in particular where YFTP thinks that the local copy is newer than the one on the server.

It appears that the trigger is that the size of this file is listed locally as 6kb and the one on the server is listed at 5kb. This is just a CSS file created by BBEdit. Any clues as so why the sizes differ?

I see that I can turn off the file size comparison in the sync operation but I'd really like to undestand what's going on here.

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2157
Re: Synch always moving a certain file
« Reply #1 on: December 04, 2007, 03:00:56 AM »
The sizes of the files can differ if the line endings are different. For example, you might have CR/LF combinations on your Mac and just LF on the server.

The 'compare size if dates match' option is designed for use where the line endings are consistent between the server and your Mac. But in this case, they appear to differ, so you're better off un-checking that option.

BarryWood

  • Jr. Member
  • **
  • Posts: 10
Re: Synch always moving a certain file
« Reply #2 on: December 04, 2007, 07:50:22 PM »
Just for curiosity sake, do you have any ideas why this would only be the case for one css file out of probably a couple of hundred html, php, and css files (all created with BBEdit) that it syncs just fine?

Are there any potential issues with turning off the size comparison for sync?

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2157
Re: Synch always moving a certain file
« Reply #3 on: December 05, 2007, 01:47:26 AM »
The only way to know for sure is for me to look at both the Mac and Server files.  Maybe you simply have an extra blank line at the end of the local copy. If you want, send me both files but make sure to download the server file in Binary format - that is, select 'Binary' as the Encoding method before downloading it. (and put it back to Auto afterwards) Send to : support at yummysoftware dot com

There shouldn't be any negative effects from un-checking the size comparison. It is there as an extra tweak, that is all.

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2157
Re: Synch always moving a certain file
« Reply #4 on: December 06, 2007, 07:33:17 AM »
To conclude, Barry sent me the two files - as I suspected, the local file has CR+LF line endings but the server file has just LF line endings. Opening the local file in BBEdit and setting the line endings to LF only (Unix) will sort out the discrepancy.

BarryWood

  • Jr. Member
  • **
  • Posts: 10
Re: Synch always moving a certain file
« Reply #5 on: December 07, 2007, 02:35:44 AM »
That's interesting because my BBEdit default line break preferences are set to Unix (LF).

I just moved the file from the server to replace my local copy and now it doesn't think it has to sync that file.

Thanks for looking at this for me.

JD

  • Administrator
  • FTP Guru
  • *****
  • Posts: 2157
Re: Synch always moving a certain file
« Reply #6 on: December 07, 2007, 06:36:05 AM »
Well, all I can tell you is that regardless of what your BBEdit defaults are set to, your local file had CR+LF line endings - the fact that replacing the local file with the server copy has made the issue go away proves that was the problem.

Anyway, glad to hear everything is now resolved :)