There are 3 types of files. Renamed txt, renamed zip, and exe
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.
Looking at you, .webp
Video files are just a bunch of zip files in a trenchcoat.
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.
What’s it called when you logically expect something to work, but are totally surprised that it actually does?
Sounds an awful lot like a normal day at work as a dev.
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 😳
that saves each audio project as an SQLite database 😳
Is this a problem? I thought this would be a normal use case for SQLite.
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
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.
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.Smh at least use 7z
zstd
or leavezstd may be newer and faster but lzma still compresses more
Thought I’d check on the Linux source tree tar.
zstd -19
vslzma -9
:❯ ls -lh total 1,6G -rw-r--r-- 1 pmo pmo 1,4G Sep 13 22:16 linux-6.6-rc1.tar -rw-r--r-- 1 pmo pmo 128M Sep 13 22:16 linux-6.6-rc1.tar.lzma -rw-r--r-- 1 pmo pmo 138M Sep 13 22:16 linux-6.6-rc1.tar.zst
About +8% compared to lzma. Decompression time though:
zstd -d -k -T0 *.zst 0,68s user 0,46s system 162% cpu 0,700 total lzma -d -k -T0 *.lzma 4,75s user 0,51s system 99% cpu 5,274 total
Yeah, I’m going with zstd all the way.
damn I did not know zstd was that good. Never thought I’d hear myself say this unironically but thanks Facebook
*Thank you engineers who happen to be working at Facebook
Also renamed xml, renamed json and renamed sqlite.
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.
Removed by mod
I’m curious, what’s wrong with webp?
Removed by mod
Is that an issue with the format or the currently available tools though?
Removed by mod