I've written a Visual Studio 2013 C# program that uses the WinSCP NET assembly (version 5.9.1) to log into an AIX Unix server, execute a remote korn shell and then downloads a file (it does more than that, but for the sake of this issue I've run into I didn't want to complicate the post).
I had initially used the SFTP protocol and every step worked as expected with no errors, but I wasn't happy with the download speed (and even if that isn't the particular issue I will describe below, I'm wondering if I can do anything about that).
I decided to give both SCP and FTP a try just to see if I could improve on the download speed.
However, for some unknown reason, when I use FTP, part of my ExecuteCommand string (a C# string variable) seems to get automatically converted from lowercase to uppercase (at least that's how the error message shows it).
Original string (works with protocols SFTP and SCP):
"$CCCS_EXE/ccc85000.ksh qc 99009 ic20140130-18.104.22.168 N/A N/A"
After a change to use the protocol FTP the string seems to become:
"$CCCS_EXE/CCC85000.KSH qc 99009 ic20140130-22.214.171.124 N/A N/A"
It's converting the name of the korn shell to uppercase (very odd behaviour since it's only a certain portion of the string) and in Unix this is obviously an issue as it will not find said korn shell (filenames are case sensitive).
I get the following exception error message:
'$CCCS_EXE/CCC85000.KSH qc 99009 ic20140130-126.96.36.199 N/A N/A' : command not understood.
Again, if I change nothing in the code except for the protocol it works with SFTP and SCP, but fails if it's FTP, in as far as the ExecuteCommmand goes.
Just to add, if I am running the program in the Visual Studio 2013 environment, if I set the protocol to FTP and I purposely skip the ExecuteCommand that would otherwise make the program fail, the file does transfer via FTP successfully, not only that, but it is also about 4 times faster than SFTP or SCP.
Bottom line, I really need to solve this issue in order to use FTP, at least for the moment, because of the speed improvement, but it is a must for me to be able to properly fire off remote korn shells as well.
Please help me!
Edit #1: I just tried version 5.9.2 and the issue is still there.
Edit #2: I'm working on trying to solve the problem at the moment and I just gave this test a whirl. I changed the string to:
"/home/parcccs/exe/ccc85000.ksh qc 99009 ic20140130-188.8.131.52 N/A N/A"
hence removing the environment variable $CCCS_EXE and it returns an error message because the string ends up being:
"/HOME/PARCCCS/EXE/CCC85000.KSH qc 99009 ic20140130-184.108.40.206 N/A N/A"
It's basically uppercase'ing anything at the start of the command line while respecting the case after the first space. As an example, if I uppercase the QC in the above string it stays in uppercase.
Edit #3: Just another particular result. I changed the string to (notice the space at the front of the string):
" /home/parcccs/exe/ccc85000.ksh qc 99009 ic20140130-220.127.116.11 N/A N/A"
and it returns an error message because the string ends up being:
" /HOme/parcccs/exe/ccc85000.ksh qc 99009 ic20140130-18.104.22.168 N/A N/A"
The only characters that got converted to uppercase were the letters H and O.