24 points

Your MOM is a renamed zip!

And if not, wow, she really kept herself in shape. Very good.

permalink
report
reply
2 points

She keeping them filled tight if you know what I mean

permalink
report
parent
reply
73 points

Or a renamed txt. Eg, .js, .py, .css, .html, .json

permalink
report
reply
60 points

Thank God they went with file name extensions so we didn’t have to preface every source .txt file with header content to instruct the editor about what kind of content it would have.

permalink
report
parent
reply
7 points

Why do I need to put that at the start of bash, desktop, and html files then?

permalink
report
parent
reply
14 points

Because both ways are used. Microsoft relies on file names, linux on the first bytes of the file.

permalink
report
parent
reply
1 point

Nothing unless you want to serve them without some other way to see what file type they are.

You can run bash scripts with bash.

Don’t know what a desktop file is.

HTML has that because webservers used to not have auto media type detection and response headers.

permalink
report
parent
reply
4 points
*

For HTML, it’s to distinguish “standards mode” HTML from “quirks mode” HTML (which doesn’t need a header).

permalink
report
parent
reply
5 points

For shell scripts it’s because bash isn’t the only shell; if you leave out the shebang line, Ubuntu will run your script in Dash instead

permalink
report
parent
reply
48 points

<!DOCTYPE JAVASCRIPT>

permalink
report
parent
reply
8 points

Oh dear God

permalink
report
parent
reply
3 points

permalink
report
parent
reply
16 points

Not really. The “file types” you’re talking about are expected to contain whatever things in a very specific format.

You’re really just saying “many file types use an efficient and common compression algorithm”. Which is correct, obvious, and to be expected.

permalink
report
reply
2 points

A .docx is just a zip file with xml documents in it.

permalink
report
parent
reply

What happens if I put an mp3 or an epub file in there with the xml? Is it still a word document?

permalink
report
parent
reply
1 point

Maybe, I was just giving an example. Like Java jar files are just zip files with other jars in them.

permalink
report
parent
reply
45 points
*

AKA “Why zip doesn’t compress things much any more”.

permalink
report
reply
0 points
*

My 1.5gb log folders disagrees. But I never tried opening a .txt in 7-zip.

permalink
report
parent
reply
2 points

?

permalink
report
parent
reply
3 points

Not sure what the original point was but curiously I happened to use file on a an Apple .numbers file recently and found that it was a .zip file in disguise with zero compression.

So maybe the point was that it’s used often as a container format more often than it’s used for compression? Just my (unrelated) general computer work would also suggest this.

permalink
report
parent
reply
9 points

Zipping a file repeatedly typically doesn’t reduce the size further after the first time.

permalink
report
parent
reply
2 points

Yeah duoy you [realistically] can’t compress compressed data…

permalink
report
parent
reply
16 points

I see images, audio, or video files distributed in zips far too often. You’re getting maybe a percent of compression if you’re lucky; just distribute the raw files or use a non-compressed bundle format like tar.

permalink
report
parent
reply
21 points

But then,

permalink
report
parent
reply
4 points

tar -cf stop-nuke.tar

permalink
report
parent
reply
19 points

The cheeky option:

tar -h

Or is it tar --help? Oh no…

permalink
report
parent
reply
21 points

tar -xzvf filename

With a bad pretend accent:

Xtract

Zee

Vucking

File

permalink
report
parent
reply
10 points

I don’t get it… I must be missing something about zipped files.

permalink
report
reply
10 points

Take a .docx file, using 7-zip, exctract it.

You will get an entire folder structure with several files inside the .docx file.

What OP means is that several programs use a zip file as a container for all the stuff they need in a save file.

The file extention is just a name for the OS to find the proper program to open the file.

permalink
report
parent
reply
21 points

OP refers to the fact that you can rename some filetypes to .zip and unpack them.

Notable examples microsoft office files (.docx) or android apps (.apk).

Counterexample are media files (mp3, mp4, jpg).

permalink
report
parent
reply
7 points

Notably, java jar files as well.

permalink
report
parent
reply
1 point

OP refers to the fact that you can rename some filetypes to .zip and unpack them.

So… you mean the zip program just rename them back? Why?

permalink
report
parent
reply
14 points

I think it makes sense from a programming view. When you have a document, you can add all the media files and pack them together as one archive. Then the program sets the filename to .docx so everyone knows that they need an office program to open that file.

For the users, all you need to know is what program can open which files. If every document would be named .zip, you would have no idea if it was a spreadsheet or slides for your presentation.

permalink
report
parent
reply
4 points

OK, thanks for all the answers. I get it, a “docx” is a zip archive expected to contain something specific making it a docx. But why “most” though?

permalink
report
parent
reply
4 points

I think ‘most’ is hyperbole for dramatic effect / increased engagement. “more files than you might think are actually following the zip file structure” isn’t as punchy.

permalink
report
parent
reply
3 points

I just didn’t think of too many file extensions when I had this thought. I was also thinking of more obscure file extensions, and not the main media formats.

permalink
report
parent
reply
12 points

There are basically two types of files. Text files and binary files.

Most information are stored in text files so humans can easily understand it, and it’s easier to find errors, review, parse. But text storage takes more space than binary files. And many complicated softwares normally need multiple text files or data files, many of them just store them together as a zip file so that it’s easier to handle. Examples are .docx,.pptx, etc files in MS Office, try unzipping them and see what they contain. Zipping also has advantages of reducing file sizes.

permalink
report
parent
reply
35 points
*

You’re not missing much. A few modern file types are zips with expected folder structures, especially MSOffice files. But this is nowhere near universally true.

You can open a file in your text editor of choice and if you see it start with PK (for Phil Katz the creator of the format and the original PKZIP/PKUNZIP programs) then it’s probably a zip.

Also, by the logic of the OP, all DLLs are EXEs.

permalink
report
parent
reply

Showerthoughts

!showerthoughts@lemmy.world

Create post

A “Showerthought” is a simple term used to describe the thoughts that pop into your head while you’re doing everyday things like taking a shower, driving, or just daydreaming. The best ones are thoughts that many people can relate to and they find something funny or interesting in regular stuff.

Rules

  • All posts must be showerthoughts
  • The entire showerthought must be in the title
  • Posts must be original/unique
  • Be good to others - no bigotry - including racism, sexism, ableism, homophobia, transphobia, or xenophobia
  • Adhere to Lemmy’s Code of Conduct

Community stats

  • 6.7K

    Monthly active users

  • 979

    Posts

  • 10K

    Comments