Page 1 of 1

Directory dates when copying with XAD

Posted: Tue Jan 26, 2021 5:24 pm
by jPV
If I unpack an archive with XAD and CopyFile(), all directories inside the archive will get an arbitrary date on them (04-Nov-02 10:30:00). Even if I define a non-existent path as the destination directory, the newly created dir gets this wrong date. They should get the current date or if real directory dates are stored in the archive, use those. Tested under MorphOS.

Code: Select all

@REQUIRE "xad", {InstallAdapter = True}

; Why directories get a date of 04-Nov-02 10:30:00? Why not the date stored in the archive (if available) or the current date?
; Even the automatically created "unpack" dir, which isn't in the archive itself, gets the 2002 date.
CopyFile("test.lha", "ram:unpack")
NPrint("Check the date of ram:unpack/testdir. It's something from 2002,\nwhich is incorrect. Click LMB.")
WaitLeftMouse
Here is everything needed for testing (.hws and test archive).

Re: Directory dates when copying with XAD

Posted: Thu Jan 28, 2021 10:45 pm
by airsoftsoftwair
04-Nov-02 10:30:00 is the start of Hollywood time because that's when Hollywood 1.0 was released :)

Still have to find out why it behaves the way it does, though :)

Re: Directory dates when copying with XAD

Posted: Sun Feb 14, 2021 9:55 pm
by airsoftsoftwair
Fixed now in both the XAD and also the ZIP plugin.

Code: Select all

- New: Added support for Hollywood's new ability to query the attributes of a directory handled
  by a directory adapter; this will allow the XAD plugin to set directory date stamps correctly when
  extracting files from an archive using Hollywood's CopyFile() function; note, however, that directories
  are often not stored as individual entries in archives; in that case, the directory date will be set
  to the current date and time because no other directory date information is available