'synchronize' fails on NULL filename
first off, I have no clue why there even is a file with a NULL filename (NULL as in nothing) or why the server allows it.
When trying to synchronize a folder containing a null filename, winscp commandline will fail as shown in the below log.
(Log has been washed for sensitive data):
Doing a dirlist and then trying a synchronize and a get on the server yields the following from winscp.com:
Note line four of the dir and the absence of a filename. Listing the same directory in winscp presents an empty filename as well and pressing delete asks for confirmation to delete ''.
I can't think of a proper way to retrieve a file with a NULL filename as NTFS wouldn't see the humor in it either so I'd suggest skipping such files or have a repeatable renaming scheme.
When trying to synchronize a folder containing a null filename, winscp commandline will fail as shown in the below log.
(Log has been washed for sensitive data):
. 2010-02-16 11:46:02.178 -------------------------------------------------------------------------- . 2010-02-16 11:46:02.178 WinSCP Version 4.2.5 (Build 624) (OS 5.2.3790 Service Pack 2) . 2010-02-16 11:46:02.178 Login time: Tuesday, February 16, 2010 11:46:02 AM . 2010-02-16 11:46:02.178 -------------------------------------------------------------------------- . 2010-02-16 11:46:02.178 Session name: [USERNAME]@[SERVER] . 2010-02-16 11:46:02.178 Host name: [SERVER] (Port: 6671) . 2010-02-16 11:46:02.178 User name: [USERNAME] (Password: Yes, Key file: No) . 2010-02-16 11:46:02.178 Tunnel: No . 2010-02-16 11:46:02.178 Transfer Protocol: SFTP . 2010-02-16 11:46:02.178 Ping type: -, Ping interval: 30 sec; Timeout: 300 sec . 2010-02-16 11:46:02.178 Proxy: none . 2010-02-16 11:46:02.178 SSH protocol version: 2; Compression: No . 2010-02-16 11:46:02.178 Bypass authentication: No . 2010-02-16 11:46:02.178 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No . 2010-02-16 11:46:02.178 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No . 2010-02-16 11:46:02.178 SSH Bugs: -,-,-,-,-,-,-,-,- . 2010-02-16 11:46:02.178 SFTP Bugs: -,- . 2010-02-16 11:46:02.178 Return code variable: Autodetect; Lookup user groups: Yes . 2010-02-16 11:46:02.178 Shell: default, EOL: 0 . 2010-02-16 11:46:02.178 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes . 2010-02-16 11:46:02.178 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No . 2010-02-16 11:46:02.178 Local directory: default, Remote directory: home, Update: No, Cache: Yes . 2010-02-16 11:46:02.178 Cache directory changes: Yes, Permanent: Yes . 2010-02-16 11:46:02.178 DST mode: 1 . 2010-02-16 11:46:02.178 -------------------------------------------------------------------------- . 2010-02-16 11:46:02.193 Looking up host "[SERVER]" . 2010-02-16 11:46:02.193 Connecting to [SERVER] port 6671 . 2010-02-16 11:46:02.818 Server version: SSH-2.0-0 . 2010-02-16 11:46:02.818 Using SSH protocol version 2 . 2010-02-16 11:46:02.818 We claim version: SSH-2.0-WinSCP_release_4.2.5 . 2010-02-16 11:46:02.818 Doing Diffie-Hellman group exchange . 2010-02-16 11:46:03.162 Doing Diffie-Hellman key exchange with hash SHA-1 . 2010-02-16 11:46:03.428 Host key fingerprint is: . 2010-02-16 11:46:03.428 ssh-dss 1024 [FINGERPRINT] . 2010-02-16 11:46:03.428 Initialised AES-256 CBC client->server encryption . 2010-02-16 11:46:03.428 Initialised HMAC-SHA1 client->server MAC algorithm . 2010-02-16 11:46:03.428 Initialised AES-256 CBC server->client encryption . 2010-02-16 11:46:03.428 Initialised HMAC-SHA1 server->client MAC algorithm ! 2010-02-16 11:46:03.834 Using username "[USERNAME]". . 2010-02-16 11:46:03.928 Prompt (6, SSH password, , &Password: ) . 2010-02-16 11:46:03.928 Using stored password. . 2010-02-16 11:46:03.928 Sent password . 2010-02-16 11:46:04.318 Access granted . 2010-02-16 11:46:04.396 Opened channel for session . 2010-02-16 11:46:04.850 Started a shell/command . 2010-02-16 11:46:04.850 -------------------------------------------------------------------------- . 2010-02-16 11:46:04.850 Using SFTP protocol. . 2010-02-16 11:46:04.850 Doing startup conversation with host. > 2010-02-16 11:46:04.850 Type: SSH_FXP_INIT, Size: 5, Number: -1 < 2010-02-16 11:46:04.943 Type: SSH_FXP_VERSION, Size: 5, Number: -1 . 2010-02-16 11:46:04.943 SFTP version 3 negotiated. . 2010-02-16 11:46:04.943 We believe the server has signed timestamps bug . 2010-02-16 11:46:04.943 We will use UTF-8 strings for status messages only . 2010-02-16 11:46:04.943 Getting current directory name. . 2010-02-16 11:46:04.943 Getting real path for '.' > 2010-02-16 11:46:04.943 Type: SSH_FXP_REALPATH, Size: 10, Number: 16 < 2010-02-16 11:46:05.053 Type: SSH_FXP_NAME, Size: 23, Number: 16 . 2010-02-16 11:46:05.053 Real path is '/' . 2010-02-16 11:46:05.053 Startup conversation with host finished. . 2010-02-16 11:46:05.053 Collecting synchronization list for local directory '\\[SERVER]\[SHARE]\ftp' and remote directory '.', mode = 1, params = 2 . 2010-02-16 11:46:05.068 Listing directory "/". > 2010-02-16 11:46:05.068 Type: SSH_FXP_OPENDIR, Size: 10, Number: 267 < 2010-02-16 11:46:05.193 Type: SSH_FXP_HANDLE, Size: 13, Number: 267 > 2010-02-16 11:46:05.193 Type: SSH_FXP_READDIR, Size: 13, Number: 524 < 2010-02-16 11:46:05.287 Type: SSH_FXP_NAME, Size: 2682, Number: 524 > 2010-02-16 11:46:05.287 Type: SSH_FXP_READDIR, Size: 13, Number: 780 < 2010-02-16 11:46:05.381 Type: SSH_FXP_STATUS, Size: 30, Number: 780 < 2010-02-16 11:46:05.381 Status code: 1 > 2010-02-16 11:46:05.381 Type: SSH_FXP_CLOSE, Size: 13, Number: 1028 . 2010-02-16 11:46:05.396 Synchronizing local directory '\\[SERVER]\[SHARE]\ftp\' with remote directory './', params = 2 . 2010-02-16 11:46:05.396 File: "/" . 2010-02-16 11:46:05.396 Copying "/" to local directory started. . 2010-02-16 11:46:05.396 Binary transfer mode selected. * 2010-02-16 11:46:05.396 (ExtException) . 2010-02-16 11:46:05.396 Asking user: . 2010-02-16 11:46:05.396 '\\[SERVER]\[SHARE]\ftp\' is not file! () * 2010-02-16 11:46:05.396 (EScpSkipFile) '\\[SERVER]\[SHARE]\ftp\' is not file! . 2010-02-16 11:46:05.396 Closing connection. . 2010-02-16 11:46:05.396 Sending special code: 12 . 2010-02-16 11:46:05.396 Sent EOF message
Doing a dirlist and then trying a synchronize and a get on the server yields the following from winscp.com:
winscp> dir drwxrwxrwx 0 0 0 0 Jul 19 19:44:00 2009 $$folder dr-xr-xr-x 0 0 0 0 Jul 19 19:44:00 2009 folder2 drwxrwxrwx 0 0 0 0 Jul 19 19:44:00 2009 folder3 -rw-rw-rw- 0 0 0 19 Feb 13 7:52:00 2010 -rw-rw-rw- 0 0 0 1296 Feb 13 4:13:00 2010 FILE1.TXT -rw-rw-rw- 0 0 0 12 Feb 13 4:32:00 2010 FILE2TXT -rw-rw-rw- 0 0 0 15 Feb 13 4:53:00 2010 FILE3.TXT -rw-rw-rw- 0 0 0 3277 Feb 13 4:12:00 2010 FILE4.TXT -rw-rw-rw- 0 0 0 14910602 Feb 13 7:52:00 2010 file5.zip -rw-rw-rw- 0 0 0 112204964 Feb 13 11:24:00 2010 FILE6.ZIP -rw-rw-rw- 0 0 0 112710042 Feb 14 0:22:00 2010 FILE7.ZIP -rw-rw-rw- 0 0 0 18288187 Feb 13 8:21:00 2010 file8.zip -rw-rw-rw- 0 0 0 36814740 Feb 13 7:32:00 2010 FILE9.ZIP -rw-rw-rw- 0 0 0 11851451 Feb 13 7:49:00 2010 FILE10.zip -rw-rw-rw- 0 0 0 19 Feb 13 7:49:00 2010 file11.txt -rw-rw-rw- 0 0 0 135 Feb 13 4:11:00 2010 FILE12.TXT -rw-rw-rw- 0 0 0 277439 Feb 13 4:13:00 2010 FILE13.TXT -rw-rw-rw- 0 0 0 85444 Feb 13 1:06:00 2010 FILE14.TXT -rw-rw-rw- 0 0 0 349336 Feb 13 1:07:00 2010 FILE15.TXT -rw-rw-rw- 0 0 0 625574 Feb 13 7:16:00 2010 FILE16.TXT -rw-rw-rw- 0 0 0 1138752 Feb 13 1:01:00 2010 FILE17.TXT winscp> synchronize local Comparing... Local '\\[SERVER]\[SHARE]\ftp' <= Remote '/' Synchronizing... '\\[SERVER]\[SHARE]\ftp\' is not file! (A)bort, (R)etry, (S)kip, Ski(p) all: Abort winscp> get * $$folder | 0 KiB | 0.0 KiB/s | binary | 0% folder2 | 0 KiB | 0.0 KiB/s | binary | 0% folder3 | 0 KiB | 0.0 KiB/s | binary | 0% '\\[SERVER]\[SHARE]\ftp\' is not file! (A)bort, (R)etry, (S)kip, Ski(p) all: Abort
Note line four of the dir and the absence of a filename. Listing the same directory in winscp presents an empty filename as well and pressing delete asks for confirmation to delete ''.
I can't think of a proper way to retrieve a file with a NULL filename as NTFS wouldn't see the humor in it either so I'd suggest skipping such files or have a repeatable renaming scheme.