Post a reply

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

rtbt

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.
martin

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

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?
martin

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.
rtbt

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."
martin

Re: Support for IBM z10 directory paths

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

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!