• Victor@lemmy.world
      link
      fedilink
      arrow-up
      55
      ·
      2 months ago

      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.

        • Revan343@lemmy.ca
          link
          fedilink
          arrow-up
          5
          ·
          2 months ago

          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

        • xigoi@lemmy.sdf.org
          link
          fedilink
          English
          arrow-up
          4
          ·
          edit-2
          2 months ago

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

        • Kairos@lemmy.today
          link
          fedilink
          arrow-up
          1
          ·
          2 months ago

          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.

    • LostXOR@fedia.io
      link
      fedilink
      arrow-up
      15
      ·
      2 months ago

      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.

      • Prison Mike@links.hackliberty.org
        link
        fedilink
        arrow-up
        2
        ·
        2 months ago

        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.

    • JasonDJ@lemmy.zip
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      edit-2
      1 month ago

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

  • fine_sandy_bottom@lemmy.federate.cc
    link
    fedilink
    arrow-up
    16
    arrow-down
    1
    ·
    2 months ago

    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.

    • IHawkMike@lemmy.world
      link
      fedilink
      arrow-up
      33
      ·
      edit-2
      2 months ago

      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.

    • thevoidzero@lemmy.world
      link
      fedilink
      arrow-up
      11
      ·
      2 months ago

      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.

    • stoy@lemmy.zip
      link
      fedilink
      arrow-up
      12
      arrow-down
      2
      ·
      2 months ago

      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.

    • mumblerfish@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      2 months ago

      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?

      • Acamon@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        2 months ago

        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.

        • Interstellar_1@lemmy.blahaj.zoneOP
          link
          fedilink
          arrow-up
          3
          ·
          2 months ago

          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.