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";