|
|
This item text has been erased.
25 responses total.
I didn't know about he "fortune" program. How does it work?
If it uses the same format as the fortune program on my linux system, the fortune data file has a header structure that's a table of offsets for the various fortune strings. This is to enable random access to the strings. There is a program called "strfile" that creates such a data file from a plain ascii file containing the strings. The program doesn't seem to be on grex, and I don't have source, but I imagine it can be ftp'd from somewhere.
(kami slipped in. Type !fortune at the next prompt.)
This response has been erased.
This response has been erased.
This response has been erased.
I've always tried to live by that prescription.
This response has been erased.
Re-read my response #2.
This response has been erased.
An archie search turned up gatekeeper.dec.com: /contrib/src/dco/fortune/src/strfile.
This response has been erased.
if you're still looking, popcorn, i *finally* got it compiled (thanx to remmers for help) .... try !/u/orinoco/strfile to run it....
...just a few questions......one, what do you use as a delimiter between strings, and two, how do you *run* the durn thing after you've changed your file into 1's and 0's?
Ok, i'm back again, answering my own questions. According to a comment in the uncompiled program, you use two consecutive linesconsisting of just a % as a delimiter. But i tried that, and it diedn't work. Rather, when I tried to run !fortune using my file, it just gave me the whole file in one chunck, %'s and all.
What does strfile do?
(Valerie's conscientious about FWing, & I'm pretty sure she reads *everything* here.) I took a glance at that comment, & I think you've got it wrong. The delimiter is any line beginning with two %s, if I understand it.
yeah, what *does* strfile do?
This response has been erased.
no, a line beginning w/two %'s doesn't work either.
Daniel, I tried compiling, setting up a test file, & running. The message from strfile appears to indicate that it did in fact use lines beginning %% as delimiters (the string count & that "shortest string" message fits this). I tried running fortune on my file, & got the results you report, though. I suspect that fortune expects some kind of format for the strings it uses, since its options include things like "offensive fortunes only" etc., but I don't have any inside info.
This response has been erased.
There seems to be just one, according to the man & according to what seems to be in the games/lib dir - but the others could be hidden. However, I really do think that this is likely given what happens. I could well be wrong. Somewhere we must have the source for fortune, surely? Not that *I* want to go digging through it!
yeah..source file is /usr/local/grexsrc/strfile/strfile.c....compiled version is /home/orinoco/strfile
Nope, Daniel, I meant the source for fortune. I glanced through the source for strfile, but I don't want to dig into it too much, either.
Response not possible - You must register and login before posting.
|
|
- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss