GNU bug report logs - #61326
30.0.50; Editing fil in zip file without extension save creates new file

Previous Next

Package: emacs;

Reported by: Adam Sjøgren <asjo <at> koldfront.dk>

Date: Mon, 6 Feb 2023 17:01:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 61326 <at> debbugs.gnu.org (full text, mbox):

From: Adam Sjøgren <asjo <at> koldfront.dk>
To: 61326 <at> debbugs.gnu.org
Subject: Re: bug#61326: Adding --no-add-suffix to zip patch
Date: Tue, 07 Feb 2023 20:59:33 +0100
Ruijie writes:

> Maybe, at least in the meantime, we change it such that all write
> operations for zip create files in temp, and move to / overwrite the
> original file when done? Although I don’t have a full understanding on
> how that would be done and whether there are problems along with it.

That sounds like a good solution, for archives with no '.' in the filename.

I guess the main problem is if the archive is huge, updating an existing
archive might (?) be more efficient than creating an entirely new one.

Another way to go about it could be to temporarily rename the archive to
have a name with a '.' in it, make the change, and then rename it back;
conceptually:

  mv a a.zip
  # update a.zip rather than a
  mv a.zip a

That has its own set of possible problems.

Maybe you could make a link to the original archive, where the link has
a '.' in the name, have zip update the file via the link and then remove
the link again; conceptually:

  ln a a.zip
  # update a.zip rather than a
  rm a.zip

I think I like this the most, but again...




This bug report was last modified 2 years and 90 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.