Topic "Winscp 4.27 broken compared to 4.21"

Author Message
wachaca72

Guest


Hello,
I have a program in C# which downloads files from a Unix server invoking winscp.com.

The program started to fail once I updated to Winscp 4.27. Allthough the files were being transfered in ASCII (according to the logs at least), the files were always in Unix on the windows server.

I downgraded from 4.27 to 4.21 and the exact same code works without a problem, downloaded files are "converted" from unix to dos in the ascii format.
Code:

            string command = "option confirm off\n" +
                "open session\n" +
                "cd og\n" +
                "option transfer ascii\n" +
                "get *C.TXT " + _path + @"\download\" + "\n" +
                "close\n" +
                "exit";

            Process winscp = new Process();
            winscp.StartInfo.Arguments = "/log=" + logname;
            winscp.StartInfo.FileName = scpDir + "winscp.com";
            winscp.StartInfo.UseShellExecute = false;
            winscp.StartInfo.RedirectStandardInput = true;
            winscp.StartInfo.RedirectStandardOutput = true;
            winscp.StartInfo.CreateNoWindow = true;
            winscp.Start();
           
            foreach (string cmd in command.Split('\n'))
            {
                winscp.StandardInput.WriteLine(cmd);
            }

 
            //winscp.StandardInput.WriteLine(command);
            winscp.StandardInput.Close();
           
            string output = winscp.StandardOutput.ReadToEnd();
            LogMsg(" scpCommands output " + output);

            /// Wait until WinSCP finishes
            winscp.WaitForExit();


The 4.27 Log file shows:
Quote:

winscp> option transfer ascii
transfer ascii
winscp> get 100507OGPEML* D:\crmfacil\crons\clientfiles\PAC\download\
100507OGPEML1.TXT | 672 KiB | 2523.5 KiB/s | ascii | 100%
100507OGPEMLC.TXT | 0 KiB | 1530.6 KiB/s | ascii | 100%
winscp> close

However the files on the windows machine are still in unix format.

Hope this helps.

cheers
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Can you post a log file from both versions?
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License