Support for IBM z10 directory paths

Advertisement

rtbt
Joined:
Posts:
3

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

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Support for IBM z10 directory paths

I think it should be $session.ListDirectory("'AAAA.AAA.AAAA.'")

Reply with quote

rtbt
Joined:
Posts:
3

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:
27,253
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:
3

This looks very similar the issue with MVS file systems (https://winscp.net/tracker/show_bug.cgi?id=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

You can post new topics in this forum