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
File sorting
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
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
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
-
- User
- Posts: 27
- Joined: Sun Jul 13, 2008 9:47 am
- Location: UK
Update
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
http://www.purebasic.com/documentation/ ... em.pb.html
http://www.purebasic.com/documentation/ ... edate.html
http://www.purebasic.com/documentation/ ... array.html
http://www.purebasic.com/documentation/ ... edate.html
http://www.purebasic.com/documentation/ ... array.html
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
-
- Enthusiast
- Posts: 781
- Joined: Fri Apr 25, 2003 6:51 pm
- Location: NC, USA
- Contact:
I suggest reading this post.
http://www.purebasic.fr/english/viewtopic.php?t=33900
There should be an idea there you can use.
http://www.purebasic.fr/english/viewtopic.php?t=33900
There should be an idea there you can use.