0 votes
by (200 points)
edited

In my tests I've noticed that when I do GetList(parentDir), the files all have FtpFile.Modified.Kind of DateTimeKind.Local.

But when I do GetFileDateTime(filePath), the returned file has FtpFile.Modified.Kind of DateTimeKind.Unspecified.

This answer explains why the kind property is Unspecified for GetFileDateTime, but I would have expected it to be consistent between the two calls. Is that by design, and can I expect the modified times from GetList to always use a Local DateTime? It's more important to me that the two times be consistent, rather than reflecting the correct timezone.

Applies to: Rebex FTP/SSL, Rebex Time

1 Answer

0 votes
by (147k points)
edited
 
Best answer

As of Rebex FTP/SSL 2012 R1, GetFileDateTime(filePath) method still uses MDTM command instead of MLST even on most servers which do support MLST/MLSD. But GetList(parentDir) does use MLSD when available. Check out the log created using Ftp object's LogWriter property to see what's actually going on.

We will change the default GetFileDateTime behavior for the next release to use MLST when available (and add an option to force the old behavior for those who depend on it).

Thanks for bringing this to our attention!

Update: Since Rebex FTP/SSL 2012 R2, GetFileDateTime uses MLST when available. Care has been taken to make the times returned by GetList and GetFileDateTime consistent, and this applies to SetFileDateTime as well.

by (120 points)
What is required in code besides
ftp.GetFileDateTime(remotepath)
to change the time to MLST
ftp.settings in VB.net does not exist.
by (58.9k points)
You seem to be on an older version of Rebex FTP component because the Ftp.Settings property was added in release 2012R1 ( no matter whether you use C# or VB.NET).

However, as written above, MLST command is used automatically since release 2012R2. You can login at www.rebex.net/protected and see what version you can actually download. If your support contract expired before 2012R2 was released (which was in June 2012), then you will need to update your support contract to be able to download the new version, which can be also done at www.rebex.net/protected page.

If you experience problem with the version 2012R2 or later, please create a log of communication as described http://www.rebex.net/kb/logging/ and then either post it here or send to support@rebex.net.
by (58.9k points)
With version 2012R2 or later the ftp.GetFileDateTime(remotePath) method should automatically pick the MLST method if the server supports it. You do not need to modify the ftp.Settings.
...