View Full Version : How to extract ZIP and restore directory dates?
shae
14th August 2008, 21:50
Does anyone know a software that will restore directory dates while extracting ZIPs?
WinRAR and 7zip don't do it. (What's the point of keeping these dates if they're not restored?)
RunningSkittle
14th August 2008, 22:54
winrar can (re)store creation time, and last access time.
-ts<m,c,a>[N]
Save or restore file time (modification, creation, access).
Switch -tsm instructs RAR to save file modification time,
-tsc - creation time and tsa - last access time. Optional
parameter after the switch is the number between 0 and 4
controlling the file time precision. Value '1' enables
1 second precision, 2 - 0.0065536 sec, 3 - 0.0000256 sec and
4 or '+' enables the maximum NTFS time precision, which is
equal to 0.0000001 sec. Value '0' or '-' means that creation
and access time are not saved and low (two seconds) precision
is used for modification time. Higher precision modes add
more data to archive, up to 19 additional bytes per file
in case of -tsm4 -tsa4 -tsc4 combination. If no precision
is specified, RAR uses '4' (high) value.
Default RAR mode is -tsm4 -tsc0 -tsa0, so modification time
is stored with the high precision and other times are ignored.
It is necessary to specify -tsc and -tsa switches to set
creation and access time when unpacking files (precision
is irrelevant, but must not be 0). By default RAR sets
only the modification time, even if archive contains
creation and last access time. Setting the modification
time to unpacked files may be also disabled with -tsm-.
It is possible to omit the time type letter if you need
to apply the switch to all three times. For example,
-tsm4 -tsa4 -tsc4 can be replaced by -ts4, -ts+ or -ts.
Use -ts- to save only the low precision modification time
or to ignore all three file times on unpacking.
When creating an archive, RAR automatically reduces
the precision if high mode is not supported by the file
system. It is not more than 2 seconds on FAT and 1 second
in Unix. NTFS time precision is 0.0000001 second.
Operating systems limit which time can be set on unpacking.
Windows allows to set all three times, Unix - modification
and last access, but not creation, DOS supports only
the modification time.
Examples:
1) rar a -ts backup
Store all file times with the highest possible precision.
2) rar x -tsa backup
Restore modification and last access time. Switch -tsm
is not required, because RAR uses it by default.
3) rar a -tsm1 -tsc1 backup
Store low precision modification and creation time.
Without -tsm1 RAR would save the high precision modification
time.
I think the gui has the options under the "advanced" tabs.
shae
15th August 2008, 02:35
It works for FAT, but not NTFS.
(NTFS timestamping is disabled, though regardless, I don't think it's related.)
M_Knox
17th August 2008, 14:11
InfoZIP's commandline unzip seems to do the job (restores both directory's creation and last modification time)
shae
30th August 2008, 01:24
Thanks. I'll have a look.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.