Dalai wrote: ↑2022-07-28, 18:09 UTCIn ReadHeader/ReadHeaderEx a plugin can (and is supposed to) return a FileTime. This timestamp seems to be wrong unless I convert it to local time before returning it to TC. Is it supposed to be this way? The WDX and WFX content plugin interfaces expect the date and time in UTC.
Yes, I think it's supposed to be like this.
I think the reason is simple: the whole wcx interface was constructed around the DOS/FAT timestamp structure for files and basically the zip archive, which can handle only local time zone timestamps. AFAIK wdx and ft_datetime expects a raw FILETIME structure, but the wcx interface expects a "DOStime", as it's basically dealing with a "virtual" filesystem. What I do to convert my UTC times to wcx local time (including DST!) is basically this order of converter functions:
That algorithm documented in TC's wcx guide
( (year - 1980) << 25 | month << 21 | day << 16 | hour << 11 | minute << 5 | second/2 )
is exactly what a DosDateTime does.
Dalai wrote: ↑2022-07-28, 18:09 UTCWhen unpacking a file TC doesn't seem to set the date and time of the unpacked file to what was listed in the archive. Correct?
Asked a different way: If I want the unpacked file to have the timestamp from the archive, I need to set it myself. Correct?
Yes, from what I see, TC doesn't touch any files itself, it just creates the folder structure for you when trying to unpack dirs. But that's basically it. You have to set all file "metadata" (attributes) by yourself.
Dalai wrote: ↑2022-07-28, 18:09 UTCWhat do the members UnpVer and Method of THeaderData(Ex) structures represent? They're not described in the WCX plugin guide.
Just a guess: UnpVer was intended for things like rar: you can only unpack rar files created with 5.0 archive format with program/DLL intended for 5.0 and higher (same for 2.0 and 2.9 format)
Method: probably for zip: deflate and deflate64 and so on. You can actually see this in a zip archive with TC's internal unpacker: it shows the method in the file properties page. But I don't think this was ever fully implemented for wcx. But of course only Christian can fully confirm/answer this.