S select Member Licensed User Longtime User Oct 25, 2023 #1 Hi, I need to find the most recent file in an FTP folder. I'm using code like this: B4X: Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry) ... DateTime.Date(Files(i).Timestamp it would appear that the date value returned is different from the one displayed in FileZilla. It's possible? Is there a better way (than comparing dates) to find the most recent file in an FTP folder? Thank you!
Hi, I need to find the most recent file in an FTP folder. I'm using code like this: B4X: Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry) ... DateTime.Date(Files(i).Timestamp it would appear that the date value returned is different from the one displayed in FileZilla. It's possible? Is there a better way (than comparing dates) to find the most recent file in an FTP folder? Thank you!
Erel B4X founder Staff member Licensed User Longtime User Oct 25, 2023 #2 You will lose the time section with DateTime.Date. Create a custom type with two fields: Time As Long and Entry As FTPEntry. B4X: Dim entries As List For Each f As FTPEntry In Files entries.Add(CreateCustomType(f, f.Timestamp)) Next entries.SortType(Time, False) Upvote 0
You will lose the time section with DateTime.Date. Create a custom type with two fields: Time As Long and Entry As FTPEntry. B4X: Dim entries As List For Each f As FTPEntry In Files entries.Add(CreateCustomType(f, f.Timestamp)) Next entries.SortType(Time, False)