• Victor
      link
      326 hours 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.

      • @foggy
        link
        246 hours ago

        <!DOCTYPE JAVASCRIPT>

      • JackGreenEarth
        link
        fedilink
        English
        46 hours ago

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

        • @[email protected]
          link
          fedilink
          76 hours ago

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

          • Consti
            link
            5
            edit-2
            5 hours ago

            Not quite correct. For html, that is to signal standard compliance, you can leave it away and the browser will still handle it. For the bash one, all (most) shell scripts use .sh, so you need to give a shebang to tell the loader which executable (sh, bash, zsh, csh, …) to use

            Also on Linux xdg does take file extensions into account, just executables do not

        • Kairos
          link
          fedilink
          13 hours 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.

          • Ephera
            link
            fedilink
            12 hours ago

            .desktop files are a Linux/Unix thing. Basically, it’s a fancy shortcut, usually to an application, which allows specifying additional infos, like e.g. translated names.
            In particular, the contents of the application menu are defined by just a folder filled with .desktop files.

            https://en.wikipedia.org/wiki/Shortcut_(computing)#Unix

  • @AbouBenAdhem
    link
    English
    27
    edit-2
    1 hour ago

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

    • LostXOR
      link
      fedilink
      239 minutes 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.

      • @AbouBenAdhem
        link
        English
        23 hours ago

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

        • Kairos
          link
          fedilink
          13 hours ago

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

  • Björn Tantau
    link
    fedilink
    137 hours ago

    Your MOM is a renamed zip!

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

  • @mumblerfish
    link
    56 hours ago

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

    • @IHawkMike
      link
      24
      edit-2
      6 hours 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.

    • @[email protected]
      link
      fedilink
      146 hours ago

      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).

      • @mumblerfish
        link
        16 hours ago

        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?

        • @[email protected]
          link
          fedilink
          116 hours ago

          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.

          • @mumblerfish
            link
            16 hours ago

            I got that from the other answers. I was just very confused why I’d have to rename them to “.zip”.

            I still don’t get why it is “most” files.

            • @[email protected]
              link
              fedilink
              66 hours ago

              I don’t think “most” applies here. Text-based files, pdf, media files and most executeable files are not .zip.

    • @thevoidzero
      link
      86 hours 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.

    • @[email protected]
      link
      fedilink
      76 hours 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
      link
      46 hours 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
        link
        24 hours 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.

        • @[email protected]OP
          link
          fedilink
          14 hours 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.