You are not logged in.

#1 2016-05-25 10:47:31

whoops
Member
Registered: 2009-03-19
Posts: 891

How do I zip (deflate) files without attributes or date?

Hi!

I've been trying to create a zip file that does not contain attributes or dates for the better part of an hour now (with 7zip, zip, and some random GUIs) but I always end up with either a random error message or a zip file that contains (at least) attributes (if not dates, too. Sometimes a broken date.).

Is this somehow not possible with the CLI tools?
Do I have to use something more lowlvl?

Last edited by whoops (2016-05-25 11:19:52)

Offline

#2 2016-05-25 11:07:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: How do I zip (deflate) files without attributes or date?

Have you read the manual pages?  I generally use tar.  There is a whole section on attribute handling.  I just tested, and it works fine here to specify attributes of all files at archive creation time.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-05-25 11:21:13

whoops
Member
Registered: 2009-03-19
Posts: 891

Re: How do I zip (deflate) files without attributes or date?

Yes, I have read the manual pages. Over an over again.

Apparently 7z can write without date (not sure that works correctly though)... and zip can write without attributes (seems to work), but neither has a way to do both?

I'll take another look at tar (again). Does it even deflate? Couldn't find anything on that topic, I thought tar was mostly for gzipping etc.
What do you mean by "specify attributes"? I don't want to include those...


edit: I just realized, "gzip" might be the same as the deflate algorithm?
edit2: Nope, if it is possible to do this with tar, I can't figure out how.
edit3: Managed to get it done by installing 7zip for windows in a wineprefix and using the GUI there. Dates can be left out by using the "tc" option of 7z and attributes are left out because it's a windows GUI wink Still looking for a better way -.-"

Last edited by whoops (2016-05-25 12:22:14)

Offline

#4 2016-05-25 14:22:13

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: How do I zip (deflate) files without attributes or date?

Sorry, I may have misunderstood.  You want an archive that doesn't even have file attributes or ownership information at all.  I have no idea if this is even possible.  On linux filesystems files *do* have these attributes.  You can modify them, change them, override them, etc, but files have them.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2016-05-25 22:45:00

whoops
Member
Registered: 2009-03-19
Posts: 891

Re: How do I zip (deflate) files without attributes or date?

Wait, what? I think I explained it wrong...

The a files / archive have attributes / date as long as they're in the filesystem and I'm not trying to change that.
I just don't want to store that information inside the archive.

- 7z can put files (deflated) into the archive without storing the date "metadata"
- zip can put files (deflated) into the archive without storing the attribute "metadata"
- I can use zip to remove the attributes, but it adds dates.
- I can use 7z to remove the dates, but it adds attributes.

The 7z GUI + wine gets rid of both (even the CLI exe doesn't seem to work that way, just the GUI), but that's a really crappy solution for multiple reasons.

Tried to do it with zlib, but that's way more lowlvl than I would have thought and I suck at python, so all I managed to do with it was break all the things. :3

Last edited by whoops (2016-05-25 22:45:20)

Offline

#6 2016-05-26 22:25:55

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,922

Re: How do I zip (deflate) files without attributes or date?

Whoops, this does sound somewhat like an XY problem.
maybe it would help if you explained WHY you need those 3 options (deflate, no attributes,no dates ) .

Last edited by Lone_Wolf (2016-05-26 22:26:57)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2016-05-27 00:00:58

whoops
Member
Registered: 2009-03-19
Posts: 891

Re: How do I zip (deflate) files without attributes or date?

Not really... it's a rather short explanation: It's a data format for an old device which only accepts it exactly that way.

( Cannot replace or modify the device. )

Offline

Board footer

Powered by FluxBB