Chage Date/Time in a File

Chage Date/Time in a File

Postby Rafael Clemente » Wed Dec 21, 2005 2:22 pm

Is there a function which permits to retrieve/exchange Date and Time of last modif. in any file. Somethig similar to the FWH SetFDate()/GetFTime() functions?
Thanks
Rafael
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Postby Antonio Linares » Thu Dec 22, 2005 6:36 am

Rafael,

You can use Directory() to retrieve the date and time. Here you have a working sample:

Code: Select all  Expand view
#include "FWCE.ch"

function Main()

   local oWnd
   
   DEFINE WINDOW oWnd TITLE "DateTime"
   
   @ 9, 2 BUTTON "Date-Time" ;
      SIZE 210, 30 ACTION ShowDateTime()

   ACTIVATE WINDOW oWnd
   
return nil   

function ShowDateTime()

   local aInfo := Directory( CurDir() + "\datetime.exe" )

   if Len( aInfo ) > 0
      MsgInfo( DToC( aInfo[ 1 ][ 3 ] ) )
      MsgInfo( aInfo[ 1 ][ 4 ] )
   endif     
   
return nil
Last edited by Antonio Linares on Thu Dec 22, 2005 7:11 am, edited 1 time in total.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41345
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Thu Dec 22, 2005 7:11 am

To change the date and time we need to use Windows API SetFileTime().

We are going to build a sample of its use.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41345
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rafael Clemente » Thu Dec 22, 2005 8:39 am

Antonio.
Thanks. I'll apreciate that. I need a certain control over the dates and times of the DBFs so that I can control their syncronization through ActiveSync
Regards
Rafael
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 6 guests