WinScp .net unable to find remote directory, while GUI could locate it.

Advertisement

abarman
Joined:
Posts:
1
Location:
USA

WinScp .net unable to find remote directory, while GUI could locate it.

Hi,
I am using Winscp.net from nuget.
I am able to open the session with the proper credentials.
It is failing at
var v = session.ListDirectory(@"'FNB.T55.'"); //The string is <single-quote>FNB.T55.<single-quote>

The FTP site is at IBM mainframe.

But I could connect using WinSCP gui.

I had to add remote directory at the advanced option as 'FNB.T55.' (Note: exactly with the . and single-quote).

I enabled the log while connecting from gui, which worked fine, and the following is the log. I am just showing the part where it is failing when I am trying to call ListDirectory in .net code.

== Log ===
. 2016-08-30 11:14:48.033 Changing directory to "'FNB.T55.'".
> 2016-08-30 11:14:48.033 CWD 'FNB.T55.'
< 2016-08-30 11:14:48.040 250 "FNB.T55." is the working directory name prefix.
. 2016-08-30 11:14:48.040 Getting current directory name.
> 2016-08-30 11:14:48.040 PWD
< 2016-08-30 11:14:48.044 257 "'FNB.T55.'" is working directory.
. 2016-08-30 11:14:48.236 Retrieving directory listing...
== Log ==

Now, while connecting using C# code, after little digging down to exception I found the following.


"winscp> ls -- \"'FNB.T55.'/\""
"Error listing directory ''FNB.T55.''."
"Could not retrieve directory listing\r"
"CWD cmd failed : EDC5129I NO SUCH FILE OR DIRECTORY."


Note: Here is some details about name directory prefix from IBM site

250: “directory” is the working directory name prefix.
Explanation
A CWD command was issued that caused the current working directory of the server to be changed to the MVS™ high level qualifier directory.

System action
FTP continues.

User response
None.

System programmer response
None.


I also used genrate url code, and it is as follows. I did hide server details.

winscp-ftpes://*****@ftp.***.***.***/%27FNB.T55.%27/

Please let me know if you see some thing obvious.

Reply with quote

Advertisement

You can post new topics in this forum