I am generating .txt files in a folder on a sdcard using FILEX. The problem is all the files created have a same timestamp of 01/01/2017. I had to create this files such that the latest file remains at the top of the folder while the oldest goes down automatically. It is same as sorting the folder by date in windows. How can i do it?. Can anyone help
Here you should have all the information you need
The link above has been removed. What is the new answer?
What was in the link - the entire source for FileX, or a way of reading each file in the file system and finding the one with the oldest/newest date?
I have the equivalent of the a linux "ls" command for FileX and the source for it somewhere. You might find both in the Microsoft GIT repo that contains ThreadX and FileX source.
But I will look around.
you can set the date and time for the files by using the code
fx_system_date_set ((UINT) ((g_system_time.tm_year - 100) + 2000), (UINT) g_system_time.tm_mon + 1, (UINT) g_system_time.tm_mday);
fx_system_time_set ((UINT) g_system_time.tm_hour, (UINT) g_system_time.tm_min, (UINT) g_system_time.tm_sec);