Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.8k views
in .NET FTP by
I am downloading files from a mainframe once an hour for processing on a Windows box. In the 1.1.8 release the Dir() method did not throw an exception if the directory was empty. In the 1.1.9 version this method now throws an Exception if the directory is empty. The reason is, the mainframe returns
"550 No data sets found." instead of a string containing "No files" or "Empty". This is easily fixed by placing a 3rd string comparision into the FTPClient at line 2330, like so:
else { 
   // throw exception if not "No files" or empty message
   if (lastValidReply.ReplyText.ToUpper().IndexOf(NO_FILES) < 0 &&
       lastValidReply.ReplyText.ToUpper().IndexOf(EMPTY_DIR) < 0 &&
       lastValidReply.ReplyText.ToUpper().IndexOf(NO_DATA_SETS_FOUND) < 0)
         throw new FTPException(reply);
      }
      return result;


and by adding a new string constant to line 728:

/// <summary>
/// Server string for OS/390 indicating no files found
/// </summary>
private static string NO_DATA_SETS_FOUND = "NO DATA SETS FOUND";

2 Answers

0 votes
by (162k points)
Thanks for the fix, we'll add it.

Postscript: added to the codebase, will be in next release.
0 votes
by
The other methods of FTPClient mostly seem to work OK for a mainframe.
I did notice that the Features() and DirDetails() methods return null, but they did not throw an FTPException either.
The Size() and ModTime() methods threw an FTPException because the response was "FTP server not configured for this operation".
I surmise this is all to be expected since the file system is just going to be a lot different on a mainframe than on Windows/UNIX.
I also attempted both active and passive mode FTP, both worked fine.

Categories

...