Re: Other information and dates of an archive
- Posted by CChris <christian.cuvier at agriculture.gouv.fr> Jan 31, 2007
- 650 views
Sergio Gelli wrote: > > > Hi Alan > > Very thanks, > > Ok, I understood that is not possible to modify the name of > the author of an archive, but how I can extract the date of > creation and the date of the last access of this archive, using > a Eu code? Is this possible? > > Best regards, > > Sérgio - Brasil
constant kernel32=open_dll("kernel32.dll"), gft=define_c_func(kernel32,"GetFileTime",repeat(C_POINTER,4),C_BOOL), ft2st=define_c_func(kernel32,"FileTimeToSystemTime",repeat(C_POINTER,2),C_BOOL), mem_area=allocate(72), create_time=mem_area, last_access=mem_area+8, last_write=mem_area+16 system_time=mem_area+24, system_last_access=mem_area+40, system_last_write=mem_area+56 atom hfile integer rc -- set hfile to a handle on your file rc=c_func(gft,{hfile,create_time,last_access,last_write) rc=c_func(create_time,system_create_time) rc=c_func(last_access,system_last_access) rc=c_func(last_write,system_last_write)
Note that some of the pointers passed to GetFileTime() may be 0. The system_* structures hold 8 16-bit words each, representing a date and a time as: * wYear * wMonth * wDayOfWeek * wDay * wHour * wMinute * wSecond * wMilliseconds To properly set hfile, you must call the CreateFile() Win32API. Please refer to the docs for it, as it is somewhat lengthy. Too bad that Eu doesn't give access to the physical handle of an open file, given its Eu handle... HTH CChris