Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Unable to connect to remote directory IBM mainframe

Duplicate post on Stack Overflow:
<invalid hyperlink removed by admin>
abarman_

Unable to connect to remote directory IBM mainframe

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

The FTP site is at IBM mainframe.

I was able to connect using WinSCP GUI.

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

Enabled the log while connecting from GUIwhich worked as following. I am just showing the part.
. 2016-08-30 11:14:48.033 Changing directory to "'EMA.S44.'".
> 2016-08-30 11:14:48.033 CWD 'EMA.S44.'
< 2016-08-30 11:14:48.040 250 "EMA.S44." 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 "'EMA.S44.'" is working directory.
. 2016-08-30 11:14:48.236 Retrieving directory listing...

Now, while connecting using C# code, digging to exception I found the following.
[cpde]
"winscp> ls -- \"'EMA.S44.'/\""
"Error listing directory ''EMA.S44.''."
"Could not retrieve directory listing\r"
"CWD cmd failed : EDC5129I NO SUCH FILE OR DIRECTORY."
[/code]
Note:Here is some details about name directory prefix....
https://www.ibm.com/docs/en/zos/latest?topic=codes-250-directory-is-working-directory-name-prefix

I also used generate URL code, and it is as follows. I did hide server details.
winscp-ftpes://*****@ftp.***.***.***/%27EMA.S44.%27/

Please let me know if you see some thing obvious.