Support for IBM z10 directory paths

Advertisement

rtbt
Joined:
Posts:
4

Support for IBM z10 directory paths

I'm trying to automate a process that works manually in the GUI using the .NET Assembly and PowerShell. The sticky point seems to be that the files I am trying to pull are hosted on an IBM z10 mainframe which uses non-unix style directory paths.

I get this error after successfully opening a session:

PS C:\Users\rtbt\Documents\FTP PowerShell Scripts> $session.ListDirectory("`'`AAA.AAA.AAAA.`'")
Exception calling "ListDirectory" with "1" argument(s): "Error listing directory ''AAA.AAA.AAAA.''.
Could not retrieve directory listing
CWD cmd failed : EDC5129I No such file or directory."
At line:1 char:1
+ $session.ListDirectory("`'`AAAA.AAA.AAAA.`'")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : SessionRemoteException


I am using FTP with Explicit TLS encryption in Active Mode. When I use the GUI I can connect to the AAA.AAA.AAAA directory successfully and download the target file. I am using the following syntax in the GUI for the remote directory (disregard the outer pair of double quotes): "'AAAA.AAA.AAAA.'"

This inclines me to think that either a) I'm not correctly escaping the single quotes in PowerShell or b) the directory pathing code is different in the .NET assembly.

Any guidance here? Are paths like these supported in the .NET Assembly?

Thanks!

Reply with quote

Advertisement

rtbt
Joined:
Posts:
4

Hmmm. Unfortunately, [c]$Session.ListDirectory("'AAA.AAA.AAAA.'")[/c] gives me the same error. I'm pretty sure it's being passed through correctly because the exception has the single quotes listed in the exception...

Exception calling "ListDirectory" with "1" argument(s): "Error listing directory ''CSAN.RCS.NSTAR.''.
Could not retrieve directory listing
CWD cmd failed : EDC5129I No such file or directory."

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,405
Location:
Prague, Czechia

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

rtbt
Joined:
Posts:
4

This looks very similar the issue with MVS file systems (https://winscp.net/tracker/1453).

When I connect using the GUI I'm able to specify the remote directory in the session options so it opens my session directly in the folder where the files reside. I cannot find a similar option in the .NET Assembly documentation so it looks like the session is opened in my user's "root" login space. Then when I try to change or list directories that login space gets attached to the beginning of my path.

I think this will work if I can specify a remote working directory prior to starting the session. Is there a way I can do this with .NET Assembly?
  • Pull-RCS-Datasets.log (6.34 KB, Private file)

Reply with quote

Advertisement

rtbt
Joined:
Posts:
4

martin wrote:

OK, I see. I'm afraid it won't work. Sorry.

Ah. Thanks for confirming this for me. I understand that the way the zOS handles file paths is different.

Reply with quote

Advertisement

You can post new topics in this forum