73 points

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

permalink
report
reply

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
48 points

<!DOCTYPE JAVASCRIPT>

permalink
report
parent
reply

Oh dear God

permalink
report
parent
reply
3 points

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
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
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
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
45 points
*

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

permalink
report
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
21 points

tar -xzvf filename

With a bad pretend accent:

Xtract

Zee

Vucking

File

permalink
report
parent
reply
19 points

The cheeky option:

tar -h

Or is it tar --help? Oh no…

permalink
report
parent
reply
4 points

tar -cf stop-nuke.tar

permalink
report
parent
reply
2 points

?

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
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
0 points
*

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

permalink
report
parent
reply
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
18 points

Counterpoint: what?

permalink
report
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
1 point

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

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. A showerthought should offer a unique perspective on an ordinary part of life.

Rules

  1. All posts must be showerthoughts
  2. The entire showerthought must be in the title
  3. Avoid politics
    1. NEW RULE as of 5 Nov 2024, trying it out
    2. Political posts often end up being circle jerks (not offering unique perspective) or enflaming (too much work for mods).
    3. Try c/politicaldiscussion, volunteer as a mod here, or start your own community.
  4. Posts must be original/unique
  5. Adhere to Lemmy’s Code of Conduct-----

Community stats

  • 7.9K

    Monthly active users

  • 1.1K

    Posts

  • 14K

    Comments