Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.9k views
in .NET FTP by (160 points)
I hope someone could help me.
I have c# code to retrieve file information from a IBM Mainframe
I'm using edtFTPnet library version 2.0.0.0
The code look like this:

String[] allfiles;
FTPFile[] filesdetail;

allfiles = ftpC.Dir();
filesdetail = ftpC.DirDetails();

Dir method work just fine, but DirDetails is throwing the following message

A first chance exception of type 'System.IndexOutOfRangeException' occurred in edtFTPnet.dll
Index was outside the bounds of the array.
at EnterpriseDT.Net.Ftp.UnixFileParser.IsValidFormat(String[] listing)
at EnterpriseDT.Net.Ftp.FTPFileFactory.DetectParser(String[] files)
at EnterpriseDT.Net.Ftp.FTPFileFactory.Parse(String[] fileStrings)
at EnterpriseDT.Net.Ftp.FTPClient.DirDetails(String dirname)
at EnterpriseDT.Net.Ftp.FTPClient.DirDetails()

There are 754 files on the directory, I also tried initializing filesdetail variable to 1000 items but still getting the same error.
I tried to test this code in a smaller directory (350 items) and the error is gone, but DirDetails method is returning an array of zero elements.
Dir method is working fine, returning all the items.

Any help would be very appreciated.

3 Answers

0 votes
by (162k points)
can you post a directory listing from command line FTP ('dir')? only a portion of course
0 votes
by (160 points)
can you post a directory listing from command line FTP ('dir')? only a portion of course


I have the following log excerpt

DEBUG [FTPControlSocket] 23 jun 2009 18:35:28.031 : ---> CWD 'PXSPP.BTCH.JCLLIB'
DEBUG [FTPControlSocket] 23 jun 2009 18:35:28.062 : 250 The working directory "PXSPP.BTCH.JCLLIB" is a partitioned data set
DEBUG [FTPControlSocket] 23 jun 2009 18:35:41.750 : ---> SYST
DEBUG [FTPControlSocket] 23 jun 2009 18:35:41.765 : 215 MVS is the operating system of this server. FTP Server is running on z/OS.
WARN [FTPFileFactory] 23 jun 2009 18:35:41.765 : Unknown SYST 'MVS is the operating system of this server. FTP Server is running on z/OS.' - defaulting to Unix parsing
DEBUG [FTPControlSocket] 23 jun 2009 18:35:41.765 : ---> PWD
DEBUG [FTPControlSocket] 23 jun 2009 18:35:41.765 : 257 "'PXSPP.BTCH.JCLLIB'" partitioned data set is working directory.
DEBUG [FTPControlSocket] 23 jun 2009 18:35:41.765 : ---> PASV
DEBUG [FTPControlSocket] 23 jun 2009 18:35:41.765 : 227 Entering Passive Mode (150,23,1,39,13,194)
DEBUG [FTPControlSocket] 23 jun 2009 18:35:41.765 : Server supplied address=150.23.1.39
DEBUG [FTPControlSocket] 23 jun 2009 18:35:41.765 : Server supplied port=3522
DEBUG [FTPControlSocket] 23 jun 2009 18:35:41.765 : NewPassiveDataSocket(150.23.1.39,3522)
DEBUG [FTPControlSocket] 23 jun 2009 18:35:41.781 : ---> LIST
DEBUG [FTPControlSocket] 23 jun 2009 18:35:41.828 : 125 List started OK
DEBUG [FTPClient] 23 jun 2009 18:35:41.828 : Reading ASCII listing data
DEBUG [FTPClient] 23 jun 2009 18:35:42.015 : --> Name VV.MM Created Changed Size Init Mod Id
DEBUG [FTPClient] 23 jun 2009 18:35:42.015 : -->A 01.03 2007/10/22 2009/05/27 20:18 30 3 0 TR6JAM
DEBUG [FTPClient] 23 jun 2009 18:35:42.015 : -->AAA 01.01 2007/06/01 2009/01/27 03:50 183 11 0 TR6AAJ
DEBUG [FTPClient] 23 jun 2009 18:35:42.015 : -->AAJSUSU 01.00 2005/08/29 2005/08/29 15:11 20 20 0 TR6MGM
DEBUG [FTPClient] 23 jun 2009 18:35:42.015 : -->ADERESSO 01.01 2007/03/15 2007/03/15 16:38 45 45 0 TR6CCU
DEBUG [FTPClient] 23 jun 2009 18:35:42.015 : -->ADRBAJA 01.05 2006/06/15 2009/05/29 11:57 22 37 18 TR6CCU
DEBUG [FTPClient] 23 jun 2009 18:35:42.015 : -->ADRCFD 01.07 2009/06/01 2009/06/01 10:56 28 80 0 TR6ASV
DEBUG [FTPClient] 23 jun 2009 18:35:42.015 : -->ADRORIG 01.05 2009/05/29 2009/05/29 11:20 16 16 0 TR6CCU
DEBUG [FTPClient] 23 jun 2009 18:35:42.015 : -->ALEXARR 01.01 2005/10/10 2005/10/10 14:47 52 50 0 TR6MGM
DEBUG [FTPClient] 23 jun 2009 18:35:42.187 : -->ALEXSCOA 01.01 2005/10/10 2005/10/10 14:48 52 52 0 TR6MGM
DEBUG [FTPClient] 23 jun 2009 18:35:42.187 : -->ALFONSO 01.02 2005/01/13 2005/05/21 07:12 69 30 0 TR6JAM
DEBUG [FTPClient] 23 jun 2009 18:35:42.187 : -->ALTER 01.00 2008/04/25 2008/04/25 23:33 12 12 0 TR6AAJ
DEBUG [FTPClient] 23 jun 2009 18:35:42.187 : -->AUTOSMXP 01.04 2006/05/24 2007/01/30 17:44 104 104 0 TR6CCC
DEBUG [FTPClient] 23 jun 2009 18:35:42.187 : -->AUTOSUSD 01.01 2006/05/24 2006/10/25 12:20 74 74 0 TR6MGM

more rows...

DEBUG [FTPClient] 23 jun 2009 18:35:59.406 : -->XRYYZ1 01.09 2009/06/11 2009/06/11 21:01 30 30 16 TR6ALP
DEBUG [FTPClient] 23 jun 2009 18:35:59.609 : -->XXX 01.01 2007/03/23 2008/11/14 08:55 4 1136 0 TR6ASV
DEBUG [FTPClient] 23 jun 2009 18:35:59.609 : -->Z 01.01 2008/04/25 2008/04/25 04:34 48 65 0 TR6ASV
DEBUG [FTPClient] 23 jun 2009 18:35:59.609 : -->ZZ 01.01 2005/05/31 2005/05/31 17:40 10 200 0 TR6AAJ
DEBUG [FTPClient] 23 jun 2009 18:35:59.609 : -->ZZZ 01.01 2007/06/26 2007/06/26 03:25 7 6 0 TR6AAJ
DEBUG [FTPClient] 23 jun 2009 18:35:59.609 : -->ZZZZ
DEBUG [FTPControlSocket] 23 jun 2009 18:35:59.609 : 250 List completed successfully.
DEBUG [FTPClient] 23 jun 2009 18:35:59.609 : Found 755 listing lines
DEBUG [FTPFileFactory] 23 jun 2009 18:35:59.609 : Parse() called using culture: Invariant Language (Invariant Country)
A first chance exception of type 'System.IndexOutOfRangeException' occurred in edtFTPnet.dll
0 votes
by (162k points)
The problem is that this listing format (MVS) isn't supported - you need a custom listing parser for it.

Categories

...