Page 1 of 1
File sorting
Posted: Thu Sep 04, 2008 11:53 am
by dannyboy99
I need to write a simple bit of code, so that I can put a gadget box up with the date of the oldest file in a backup directory.
I can examine the directory, but cannot work out how to continue.
Any ideas please
Posted: Thu Sep 04, 2008 12:30 pm
by pdwyer
if you need to actually sort then load to an array and use the sortarray the get the last element.
or if you just need the oldest date, as you loop through them, keep the currentoldest in memory and compare, if older than currentoldest then currentoldest = currentfile
Update
Posted: Thu Sep 04, 2008 1:18 pm
by dannyboy99
I just need a small bit of code to tell the users via a gadget box, the date of the oldest file in the backup directory so they will know when the files were last moved into a removal hd
Posted: Thu Sep 04, 2008 2:00 pm
by pdwyer
Posted: Thu Sep 04, 2008 4:17 pm
by TerryHough
I suggest reading this post.
http://www.purebasic.fr/english/viewtopic.php?t=33900
There should be an idea there you can use.