0 votes
by (330 points)
edited

I want to get the newest file in a directory and I assume the best way to do that is use GetList on the directory and look at the modified date on each file and then call GetFile on it. The problem is the modified date on each file show as today even though I use another FTP client and it shows the correct modified date. How do I get the actual modified date.

  FtpList files = ftp.GetList();
            string[] arrFiles = new string[files.Count];
            for (int i = 0; i < files.Count; i++)
            {
                arrFiles[i] = files[i].Name + ' ' + files[i].Modified;

            }

1 Answer

0 votes
by (18.1k points)
edited

There was a bug in versions 2012 R1 and 2012 R2 which caused this behavior when retrieving file listings from AS/400 mainframe servers.

This has been fixed in 2012 R3.

by (330 points)
edited

I tried the new hotfix dlls and still have the same issue. I don't get anything back for CreationTime or LastWriteTime and I get the current date and time for Modified.

I tried my older version 3.0.4086 and the modified date and time is still the current time.

I am connecting to a mainframe in case that matters.

by (18.1k points)
edited

Thank you for your report. We should analyze your situation in more details. Could you, please create a communication log accoding to http://www.rebex.net/kb/logging/

Then please send us the log to support@rebex.net.

by (330 points)
edited

Sent the log

by (148k points)
edited

This has been fixed in version 2012 R3.

by
edited

I have the same problem, and I only recently downloaded the product. So I don't believe this has been fixed.

by
edited

Actually my problem is different. The library is working as it should. In my case my devices date and time was set to the incorrect year. Since the FTP server doesn't return a year for this field (thus meaning the current year) the incorrect year was used (and day/month correct). So please disregard previous post ;)

...