lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.1k stars 161 forks source link

Problems creating and accessing remote file names that contain colons #142

Open nissanleafer opened 9 years ago

nissanleafer commented 9 years ago

Here's an example error response from lftp:

Making directory `global/clients/win8_conference/0000003 2015-04-13 19:19:02' ln: Fatal error: 500 Unknown SITE command. mirror: Access failed: 550 Failed to change directory. (/old_server/global/clients/win8_conference/0000002 2015-04-08 19:18:55)

If I manually use lftp to access the same directory, if I type in the path verbatim above I get the same error. However, if I use the type ahead feature the colons are replaced by underscores and I can change to the folder successfully: cd /Home/old_server/global/clients/win8_conference/0000002\ 2015-04-08\ 19_18_55/

Is there any way to tell lftp to convert dashes to underscores in the same way?

Thanks!

nissanleafer commented 9 years ago

I did want to add that I downloaded the latest stable code from the lftp site today and am running 4.6.1. When I ran the older version 4.0.9 I did not get the "ln: Fatal Error: 500 Unknown SITE command" error. In fact the older version was able to successfully create the folder even with the dashes. It just wasn't able to access the folder after it was created. That is why i upgraded to the latest version.

Thanks for your help in advance.

lavv17 commented 9 years ago

I think it's a very obscure feature of the server to convert the directory name on creating but not on changing. Try to file a bug report to the server maintainers. Also include debug output of lftp.

вт, 14 апр. 2015, 11:08, nissanleafer notifications@github.com:

I did want to add that I downloaded the latest stable code from the lftp site today and am running 4.6.1. When I ran the older version 4.0.9 I did not get the "ln: Fatal Error: 500 Unknown SITE command" error. In fact the older version was able to successfully create the folder even with the dashes. It just wasn't able to access the folder after it was created. That is why i upgraded to the latest version.

Thanks for your help in advance.

— Reply to this email directly or view it on GitHub https://github.com/lavv17/lftp/issues/142#issuecomment-92686767.

nissanleafer commented 9 years ago

After some research I was able to determine that the problem is probably related to the fact that the remote server is a Windows server and we are trying to mirror from a Linux server. Windows does not support colons in a file or path name. Therefore, the remote server is compensating by automatically switching the colons to underscores when storing the data instead of throwing an error. At least that was what happened using version 4.0.9 of lftp. As already mentioned, version 4.6.1 does not allow creating the folders anymore either.

I understand your response as it is strange that in version 4.0.9 I was allowed to create, but not change to a folder containing a colon, but now that does not work in version 4.6.1 for either case. I don't know how 4.0.9 handled the create/change folder process, but something definitely was changed in how it handled this.

As I don't think this is a defect of the remote server given the limitation in storing paths with colons, we have remedied the situation by changing the specs of our BURP backup process to change the time stamp format used when creating folder names from colon to underscores, just how the remote server likes it. We were lucky enough to have this flexibility.

My one thought would be for lftp to allow an option/parameter that compensates for this incompatibility between Linux and Windows file name formats by forcing an underscore in place of colons when the option/parameter is set for both put and get options (in mirror, of course).

lavv17 commented 9 years ago

To find out what changed between 4.0.9 and 4.6.1 try to turn on debug in lftp (command debug) and compare the output.