Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions Subject: Re: Why is fortune writing to the fortunes.dat file? Message-ID: <11670@bloom-beacon.MIT.EDU> Date: 25 May 89 19:10:05 GMT References: <883@apctrc.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 24 In article <883@apctrc.UUCP> zjat02@trc.amoco.com (Jon A. Tankersley) writes: >The subject says it all. This requires /usr/games to be mounted rw. >I can understand things like hack and the like that keep usage information >but does fortune really need this? I strip out most of the games, but >fortune has kinda universal approval. Would it be better to have it >try the rw open and not try to write if it has ro access? The fortune program doesn't really return a "random" fortune each time it is run. Instead, it goes through the fortunes.dat file sequentially, and each time the program is run it prints out the next appropriate fortune. In order to keep track of where it is in the file, it has to write its current location to the file after each time it reads a fortune. I've looked at the code for a few minutes and it's a bit obscure (to me at least), but this is the general idea of what occurs. Anybody know more details (like the format of the binary data at the beginning of the .dat files, for example)? Jonathan Kamens USnail: MIT Project Athena 410 Memorial Drive, No. 223F jik@Athena.MIT.EDU Cambridge, MA 02139-4318 Office: 617-253-4261 Home: 617-225-8218