MacOS can have extra characters at the end of the permissions to indicate extra attributes. Here's some examples:
-rw-r--r--@ 1 joel admin 15364 Nov 27 16:10 .DS_Store
drwx------+ 12 joel admin 408 Nov 28 14:45 Desktop
In MacOS 10.5 (Leopard), Apple added '@' to indicate a file has extended attributes. WinSCP 4.0.5 does not handle the '@' character. When connecting from my Windows XP box to my Mac, I get this error:
Error listing directory '/Users/joel'
'@' is not a valid integer value.
It appears there is code in core/RemoteFiles.cpp to handle the '+', but not the '@'.
I believe the fix is:
% diff core/RemoteFiles.cpp*
701c701
< if (!Line.IsEmpty() && ((Line[1] == '+') || (Line[1] == '@')))
---
> if (!Line.IsEmpty() && (Line[1] == '+'))
705c705
< else if ((Line.Length() >= 2) && (Line[1] == ' ') && ((Line[2] == '+') || (Line[2] == '@')))
---
> else if ((Line.Length() >= 2) && (Line[1] == ' ') && (Line[2] == '+'))
Here's the relevant information from the man page for "ls":
If the file or directory has extended attributes, the permissions field printed by the -l option is followed by a '@' character. Otherwise, if the file or directory has extended security information, the permissions field printed by the -l option is followed by a '+' character.