• Toribor@corndog.social
      link
      fedilink
      English
      arrow-up
      51
      ·
      edit-2
      1 year ago

      I’d argue with this, but it seems like image and video file extensions have become a lawless zone with no rules so I don’t even think they count.

        • fibojoly@sh.itjust.works
          link
          fedilink
          arrow-up
          7
          ·
          edit-2
          1 year ago

          Back in the day, when bandwidth was precious and porn sites would parcel a video into 10 second extracts, one per page, you could zip a bunch of these mpeg files together into an uncompressed zip, then rename it .mpeg and read it in VLC as a single video. Amazing stuff.

        • Natanael@slrpnk.net
          link
          fedilink
          arrow-up
          4
          ·
          1 year ago

          Tar.gz is pretty much like zip. Technically tar mimics a file system more closely but like who makes use of that?

      • Appoxo@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        11
        arrow-down
        1
        ·
        edit-2
        1 year ago

        No. But the Windows office suite is
        You can rename a docx and extract it.
        Don’t know how it is with ppt/x and xls/x

        • MonkderZweite@feddit.ch
          link
          fedilink
          arrow-up
          8
          ·
          1 year ago

          xls & co. (the older ones) are something custom. Only after standardization as OOXML (a shitshow btw, there’s a lengthy wiki article about it) they got zip.

          • Appoxo@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            3
            ·
            1 year ago

            The whole Word and Libre/OO-Writer world is a shit show.
            So complex and everyone decides to interpret it a bit differently.
            Not even Libre and OO can be interoperabel between the same file and feature.

          • fibojoly@sh.itjust.works
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            No. The Office ???x files are archives. Inside them you can find folders with resources. Among those, you can find files written in markup languages.

            Not quite the same thing.

            Just rename your .docx file as .zip to check its contents.

            • Fonzie!@ttrpg.network
              link
              fedilink
              arrow-up
              2
              ·
              1 year ago

              Ah, last time I checked it was a kind of ML directly (XML, I’m guessing from cymor@midwest.social their comment), but that’s back in Office 2016’s time, so things might have changed.

              Thanks for the heads-up!

      • unalivejoy@lemm.ee
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        1 year ago

        Just because you can open it with 7-zip doesn’t mean it’s a zip file. Some exes are also zip files.

  • 𝒍𝒆𝒎𝒂𝒏𝒏@lemmy.one
    link
    fedilink
    arrow-up
    89
    arrow-down
    2
    ·
    1 year ago

    Ah, good ol’ Microsoft Office. Taken advantage of their documents being a renamed .zip format to send forbidden attachments to myself via email lol

    On the flip side, there’s stuff like the Audacity app, that saves each audio project as an SQLite database 😳

    • Hexagon@feddit.it
      link
      fedilink
      arrow-up
      52
      arrow-down
      1
      ·
      1 year ago

      Also .jar files. And good ol’ winamp skins. And CBZ comics. And EPUB books. And Mozilla extensions. And APK apps. And…

          • neo (he/him)@lemmy.comfysnug.space
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 year ago

            a lot of the time i handle it manually since i try to pack things in “volumes” that most closely mimic physical releases, and writing the code to get that information would be slower than just looking it up manually

            so, for example, the first volume of bleach has 7 chapters, so i’d pack those 7 chapters together into one cbz, the second volume in another cbz, etc.

    • beeb@lemm.ee
      link
      fedilink
      arrow-up
      29
      arrow-down
      1
      ·
      1 year ago

      an SQLite database

      Genius! Why bother importing and exporting

    • mogoh@lemmy.ml
      link
      fedilink
      arrow-up
      18
      ·
      1 year ago

      that saves each audio project as an SQLite database 😳

      Is this a problem? I thought this would be a normal use case for SQLite.

      • fiah@discuss.tchncs.de
        link
        fedilink
        arrow-up
        16
        ·
        1 year ago

        doesn’t sqlite explicitly encourage this? I recall claims about storing blobs in a sqlite db having better performance than trying to do your own file operations

        • MNByChoice@midwest.social
          link
          fedilink
          arrow-up
          13
          arrow-down
          6
          ·
          edit-2
          1 year ago

          Thanks for the hint. I had to look that up. (The linked page is worth a read and has lots of details and caveats.)

          The scope is narrow, and well documented. Be very wary of over generalizing.

          The measurements in this article were made during the week of 2017-06-05 using a version of SQLite in between 3.19.2 and 3.20.0. You may expect future versions of SQLite to perform even better.

          https://www.sqlite.org/fasterthanfs.html

          SQLite reads and writes small blobs (for example, thumbnail images) 35% faster¹ than the same blobs can be read from or written to individual files on disk using fread() or fwrite().

          Furthermore, a single SQLite database holding 10-kilobyte blobs uses about 20% less disk space than storing the blobs in individual files.)

          Edit 5: consolidated my edits.

      • H4mi@lemm.ee
        link
        fedilink
        arrow-up
        18
        ·
        1 year ago

        I don’t even use a file system on my storage drives. I just write the file contents raw and try to memorize where.

          • 257m@lemmy.ml
            link
            fedilink
            arrow-up
            3
            ·
            1 year ago

            Sounds inefficient. You can only store 8 gigs and goes away when you shut off your computer? I just put it on punch cards and feed it into my machine.

      • dan@upvote.au
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Linux mostly doesn’t use file extensions… It relies on “magic bytes” in the file.

        Same with the web in general - it relies purely on MIME type (e.g. text/html for HTML files) and doesn’t care about extensions at all.

        • fibojoly@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          “Magic bytes”? We just called them headers, back in my day (even if sometimes they are at the end of the file)

          • dan@upvote.au
            link
            fedilink
            arrow-up
            3
            ·
            1 year ago

            The library that handles it is literally called “libmagic”. I’d guess the phrase “magic bytes” comes from the programming concept of a magic number?

            • fibojoly@sh.itjust.works
              link
              fedilink
              arrow-up
              2
              ·
              1 year ago

              I did not know about that one! It makes sense though, because a lot of headers would start with, well yeah, “magic numbers”. Makes sense.

    • dan@upvote.au
      link
      fedilink
      arrow-up
      8
      ·
      edit-2
      1 year ago

      SQLite explicitly encourages using it as an on-disk binary format. The format is well-documented and well-supported, backwards compatible (there’s been no major version changes since 2004), and the developers have promised to support it at least until the year 2050. It has quick seek times if your data is properly indexed, the SQLite library is distributed as a single C file that you can embed directly into your app, and it’s probably the most tested library in the world, with something like 500x more test code than library code.

      Unless you’re a developer that really understands the intricacies of designing a binary data storage format, it’s usually far better to just use SQLite.

  • observantTrapezium@lemmy.ca
    link
    fedilink
    arrow-up
    40
    arrow-down
    1
    ·
    1 year ago

    Nothing wrong with that… Most people don’t need to reinvent the wheel, and choosing a filename extension meaningful to the particular use case is better then leaving it as .zip or .db or whatever.

    • CoderKat@lemm.ee
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 year ago

      Totally depends on what the use case is. The biggest problem is that you basically always have to compress and uncompress the file when transferring it. It makes for a good storage format, but a bad format for passing around in ways that need to be constantly read and written.

      Plus often we’re talking plain text files being zipped and those plain text formats need to be parsed as well. I’ve written code for systems where we had to do annoying migrations because the serialized format is just so inefficient that it adds up eventually.

      • dan@upvote.au
        link
        fedilink
        English
        arrow-up
        5
        ·
        1 year ago

        They both have their use cases. Zstandard is for compression of a stream of data (or a single file), while 7-Zip is actually two parts: A directory structure (like tar) plus a compression algorithm (like LZMA which it uses by default) in a single app.

        7-Zip is actually adding zstd support: https://sourceforge.net/p/sevenzip/feature-requests/1580/

        • TechieDamien@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          1 year ago

          Well when using zstd, you tar first, something like tar -I zstd -cf my_tar.tar.zst my_files/*. You almost never call zstd directly and always use some kind of wrapper.

          • dan@upvote.au
            link
            fedilink
            arrow-up
            7
            ·
            1 year ago

            Sure, you can tar first. That has various issues though, for example if you just want to extract one file in the middle of the archive, it still needs to decompress everything up to that point. Something like 7-Zip is more sophisticated in terms of how it indexes files in the archive, so I’m looking forward to them adding zstd support.

            FWIW most of my uses of zstd don’t involve tar, but it’s in things like Borgbackup, database systems, etc.