brackets-ftp-sync icon indicating copy to clipboard operation
brackets-ftp-sync copied to clipboard

Escape spaces in file names before calling ls in FTP.exists

Open ryanmcfall opened this issue 10 years ago • 3 comments

This fixes a bug in which filenames containing spaces are uploaded to the server every time that a sync operation is initiated. The bug occurs because, at least on the ftp server that I am using, the ls command invokes the callback with a data argument whose length property is zero, therefore indicating to ftp-sync that the file does not exist on the server.

This should potentially be considered a bug in jsftp rather than ftp-sync, so perhaps it should be reported there instead; I'll leave that decision to you.

ryanmcfall avatar Jul 14 '15 15:07 ryanmcfall

Thanks for this and awesome to see contributions. With changes in core.js, I want to review and test these pretty thoroughly before bringing them into the codebase.

timburgess avatar Jul 16 '15 22:07 timburgess

Tim:

Note that I was unaware that committing to the forked version of the repository after submitting a pull request would result in those changes being part of the pull request (I thought it was static).

So the original pull request is just the commit with SHA 1feb3d024737b4de76be78c5b2d7b73e784fdd67, which only changes FTP.js

The subsequent commits eliminate the checking of file sizes on the server altogether, by recording (in .ftpsync_settings) the local time when a sync was last completed, and then comparing file modification dates to that date in order to determine what needs to be uploaded.

This change seems to be working for me, but more eyes on it and additional testing would certainly be good.

ryanmcfall avatar Jul 17 '15 12:07 ryanmcfall

OK. I have cherry-picked 1feb3d0 into the master branch.

timburgess avatar Jul 19 '15 05:07 timburgess