File Timestamp

Just starting out? Need help? Post your questions and find answers here.
Waussie
User
User
Posts: 24
Joined: Fri Nov 11, 2005 12:14 pm

File Timestamp

Post by Waussie »

Hi,

I'm trying to code the following:

Search a directory for files with a specific fileextension and get the newest file according to windows timestamp.
I need to get it based on time instead of date, but can't find any commands for it in Purebasic.
Anyone have any ideas?
Currently coding the unbelievable WFS program...
You'll know it, when it gets released...
Waussie
User
User
Posts: 24
Joined: Fri Nov 11, 2005 12:14 pm

Re: File Timestamp

Post by Waussie »

I managed to code this, using this code:

NbFiles=SearchFilesInit("H:\My Documents\","*.stv",0)

Repeat
File$=SearchFilesGet()
If File$="" : Break : EndIf
datum$ = FormatDate("%yyyy%mm%dd%hh%ii%ss", GetFileDate(File$, #PB_Date_Modified))
If Val(datum$) > Val(datumlast$)
datumlast$ = datum$
laatste$ = File$
EndIf

ForEver

MessageRequester("Last created .stv file was: ", laatste$,#PB_MessageRequester_Ok)
Currently coding the unbelievable WFS program...
You'll know it, when it gets released...
Post Reply