Menu

#2 Is it possible to unzip with current timestamp

open
nobody
None
5
2007-09-29
2007-09-29
Stormy
No

My question is very simple. I have a need to unzip files with the current timestamp rather the one that is stored in the archive. is that possible? planned? already available? I'm running linux.

Thanks

Stormy

Discussion

  • Ed Gordon

    Ed Gordon - 2007-10-07

    Logged In: YES
    user_id=1172496
    Originator: NO

    Please submit this request using the Info-ZIP web page form so more developers can see the request. In particular, this request needs to go to the UnZip Maintainer.

    However, as far as I know there is no option to not set the file dates. It would be easy to do, setting the dates is what takes more steps, but would be contrary to how archives are usually extracted. It's also not clear how much use that option would be to others.

    Can you just extract the files normally then recursively use the touch command to update them to the current date and time?

     
  • Stormy

    Stormy - 2007-10-09

    Logged In: YES
    user_id=674774
    Originator: YES

    I couldn't find the info-zip webpage that allows actual submission of the request, it points to various places, but couldn't find the right place.

    the problem is that on linux the tmpwatch process wakes up at 4am and if the unzip (takes a long time) happens to be at 4am, then some files will be deleted by tmpwatch. I can't expect that:
    a. all users will disable the default tmpwatch crontab
    b. define a different /tmp location (/tmp is the defactor standard)

    so, the best way is for zip to provide that facility. using touch recursively still leaves the window of opprotunity for tmpwatch to delete the just unzipped files, since they are older than 10 days.

     
  • Ed Gordon

    Ed Gordon - 2008-09-29

    Given that UnZip development is currently behind Zip development, can't say for sure when this might get done. It's possible the changes to add timestamp updating in Zip or ZipNote mentioned elsewhere may get done first. It does make sense to do as extracting to /tmp on Unix is a generally useful thing. We'll take a look at how hard this might be.

     
  • Ed Gordon

    Ed Gordon - 2008-09-29

    Given that UnZip development is currently behind Zip development, can't say for sure when this might get done. It's possible the changes to add timestamp updating in Zip or ZipNote mentioned elsewhere may get done first. It does make sense to do as extracting to /tmp on Unix is a generally useful thing. We'll take a look at how hard this might be.

     
  • Steven Schweda

    Steven Schweda - 2012-02-28

    UnZip 6.0 added a "-D" option to allow this. The UnZip 6.0 behavior
    on non-VMS systems is:

    (default) Set timestamps on extracted files, and on created directories.
    -D Set timestamps on extracted files, not on created directories.
    -DD Set no timestamps.

    The UnZip 6.0 behavior on VMS systems is:

    --D Set timestamps on extracted files, and on created directories.
    (default) Set timestamps on extracted files, not on created directories.
    -D Set no timestamps.

    UnZip 6.1 is expected to change the syntax of all negated options,
    and the semantics of "-D" on non-VMS systems. The planned UnZip 6.1
    behavior on all systems is:

    -D- Set timestamps on extracted files, and on created directories.
    (default) Set timestamps on extracted files, not on created directories.
    -D Set no timestamps.

    Note that, strictly speaking, UnZip does not _extract_ an archived
    directory, it _creates_ a new directory, and the contents of this new
    directory may differ from the contents of the original directory. (The
    archive might not include all the files which were in the original
    directory.) Because Zip does not record whether a full directory or a
    partial directory was archived, UnZip does not know if the recorded
    timestamp information for a directory is valid for the newly created
    directory. Therefore (as of UnZip 6.1, everywhere), the user must
    explicitly request directory timestamps to be set according to archived
    information ("-D-").

     

Log in to post a comment.