3 ms·
'cookies.sqlite is most definitely not a "text file"' I have a mildly differing opinion. Are not all files, by default, text files? It is just the way the text
by A4ET8a8uTh0 4y ago
'cookies.sqlite is most definitely not a "text file"'
I have a mildly differing opinion. Are not all files, by default, text files? It is just the way the text inside them is structured that determines their actual format?
edit: I might be opening a can of worms here, because I have a suspicion people will start pointing to extensions and whatnot.
- hedora 4y agoThe internet predates sqlite. They used to be stored as a directory of .txt files.
- jwilk 4y agoOr more precisely: cookies (1994) predate SQLite (2000).
- Tijdreiziger 4y agoI think all files are, by default, binary files, and it’s the binary data inside them that determines their actual format. Try opening a non-text file (e.g. an executable) in a text editor — the editor will probably try to interpret the file as Latin-1 text, but this will just look like garbage, and can’t really be said to be a sane representation of the contents of that file.
- falcolas 4y agoTo add to this, a text file is only special because it’s binary contents are restricted(ish) to a set of numbers an editor knows how to interpret into human-readable glyphs. Now then, if you want to discuss how most modern (non-executable) file formats are just zip files, then we can have more fun.
- deleted 4y ago[deleted]
- krapp 4y agoText files map to character encodings that represent human language - they're meant to be written and read directly by human beings. While all text files are binary, not all binary files are text. A database file can contain text, but it isn't a text file in and of itself.
- throwaway09223 4y ago"Are not all files, by default, text files?" No. Text files describe a particular record format. In ASCII, records are 1 byte long and always have the MSB set to zero. The unicode record format is more complicated, but it also has a clear specification. Files not in these formats are not text files.
- ptx 4y agoIf "text" means binary data where the numbers represent characters according to some mapping (code page), then there can be binary files containing no text, binary files containing among other things some text or binary files consisting entirely of text. For example, a file of raw audio samples doesn't contain any text. (You could interpret it as text in some code page if (unlike e.g. ISO 8859-1) all bytes are valid in that code page, but you'd end up with nonsense.) An SQLite file definitely contains text, but also other things, so it's not "plain text". If "text file" means a file consisting entirely of text, and nothing else, it's not a text file.
- A4ET8a8uTh0 4y agoThank you for your explanation. Admittedly, I was not thinking of plain text. I was thinking of the first option with the wrong interpretation of the word binary, which made me automatically jump to conclusion that binaries are basically 1s and 0s[1] and clearly it is not that simple. Thank you everyone. It feels like today I re-learned something I misunderstood a long time ago. https://apple.stackexchange.com/questions/364789/why-isnt-a-binary-file-shown-as-0s-and-1s https://apple.stackexchange.com/questions/364789/why-isnt-a-...
- Tijdreiziger 4y ago> which made me automatically jump to conclusion that binaries are basically 1s and 0s[1] and clearly it is not that simple. It essentially _is_ that simple, it’s just how you interpret those 1s and 0s. Say you try to interpret a PNG file as text: you get some representation of the 1s and 0s in that file, just not the right one.