TIL there is no good equivalent of fortune for the windows command prompt
@typhlosion Microsoft really quit caring about the command prompt some time ago. It began with not releasing MS-DOS as a separate product starting with Windows 95. Almost everything is supposed to be done through the GUI which makes writing batch files/shell scripts damn near impossible because you can't automate mouse movements.
@skquinn oh well. my not caring about that bullshit is aggressive enough that i'm just writing my own
AND IT'LL BE CROSS PLATFORM AND SUPPORT PLAINTEXT, because i care about bringing these truly important utilities into the 21st century
@skquinn from what i've gathered reading up about it, apparently it'd require significant porting effort for some reason, at least for the original BSD impl
but i can't imagine a version that uses a plaintext database would be hard to write, and if i figure out how the original database is formatted i could implement support for it later
@typhlosion @skquinn
The format is strfile -- a flat format consisting of a dat file which has a list of offsets to the beginnings of fortunes in the second, paired file.
I'm not sure if it encodes length or if it expects the offsets to be in order (with the end being the next start offset minus three bytes, because the separator for the text part is '\n%\n')
@skquinn @typhlosion
But, you could just escape newlines and split on lines and be fine if you didn't want to support the original format.
@enkiv2 @skquinn > (hi i'm talking about this over here now cos this is my code talkin account)
yeah i've been investigating the strfile format just now, in principle it doesn't seem too difficult but if i want to make my program compatible with the databases from the other fortune program i gotta know how it works eheh
@typhlosion In years past I'd just go over to my Windows box and try it. However, I ran from that dumpster fire over a decade ago and haven't really looked back, for better or worse.