bueno..
te preparé un ejemplo.
solamente utilicé las informaciones de fechas. la función en realidad devuelve MUCHO más que los datos de fechas.
fíjate en dwfileattributes, que contiene un long en donde están todas las informaciones de un archivo. Dejo a tu imaginación como usar and y or para bitwise operations : )
cualquier duda me la puedes consultar.
buena suerte.
//variables
ulong GetFileExInfoStandard = 0
//funciones externas
function ulong &
GetFileAttributesEx(ref string fileName, &
ulong infoLevel, &
ref win32_file_attribute_data info) &
library "kernel32" &
alias for "GetFileAttributesExA"
function ulong &
FileTimeToSystemTime(filetime ftime, &
ref systemtime stime) &
library "kernel32"
//estructuras
global type filetime from structure
long dwlowdatetime
long dwhighdatetime
end type
global type systemtime from structure
integer wyear
integer wmonth
integer wdayofweek
integer wday
integer whour
integer wminute
integer wsecond
integer wmilliseconds
end type
global type win32_file_attribute_data from structure
ulong dwfileattributes
filetime ftcreationtime
filetime ftlastaccesstime
filetime ftlastwritetime
ulong nfilesizehigh
ulong nfilesizelow
end type
//código de ejemplo. requiere tener un nombre de archivo en ls_path y
// un listbox llamado lb_1 en una ventana cualquiera.
string ls_path
string ls_file
win32_file_attribute_data info
int ret
systemtime stimecreation
systemtime stime
string ls_date
lb_1.reset( )
long ll_filesize
if getfileopenname("",ls_path,ls_file) <> 1 then return
lb_1.additem( "Get Info of " + ls_path )
ret = getfileattributesex( ls_path, GetFileExInfoStandard, info )
lb_1.additem( "Call Result = " + string(ret))
if ret = 0 then
lb_1.additem( "Cannot read file attributes")
return
end if
//fecha
ret = filetimetosystemtime( info.ftcreationtime , stimecreation )
if ret = 0 then
lb_1.additem( "Cannot read file creation time")
return
end if
ls_date = string(stimecreation.whour ) + "/" + &
string(stimecreation.wmonth ) + "/" + &
string(stimecreation.wyear )
lb_1.additem( "File created on " + ls_date )
ret = filetimetosystemtime( info.ftlastaccesstime , stimecreation )
if ret = 0 then
lb_1.additem( "Cannot read file last access time")
return
end if
ls_date = string(stimecreation.whour ) + "/" + &
string(stimecreation.wmonth ) + "/" + &
string(stimecreation.wyear )
lb_1.additem( "File last accessed on " + ls_date )
ret = filetimetosystemtime( info.ftlastwritetime , stimecreation )
if ret = 0 then
lb_1.additem( "Cannot read file last write time")
return
end if
ls_date = string(stimecreation.whour ) + "/" + &
string(stimecreation.wmonth ) + "/" + &
string(stimecreation.wyear )
lb_1.additem( "File last written on " + ls_date )
ll_filesize = long(info.nfilesizelow,info.nfilesizehigh)
lb_1.additem( "File size " + string( ll_filesize ))