Text File

Aucbvax.2923 fa.unix-wizards utzoo!decvax!ucbvax!unix-wizards Thu Sep 3 08:34:21 1981 /usr/spool/mail >From decvax!duke!unc!smb@Berkeley Thu Sep 3 08:25:35 1981 The Berkeley mail program comes with several different 'local.c' files, all of which have a routine called 'demail'. Several of these truncate the file rather than remove it; this would be much more secure.

I assume that the 'standard' version deletes the file to keep the directory small and the search time to a minimum; this is probably most important to the shell's mail check. But if you truncate the file instead, the shell could keep it open and do fstats, which are much quicker. There are a few tricky points to that (remembering the FIOCLEX, watching out for someone removing the mailbox, seeing if has changed, watching out for the permissions being changed by the real owner even though you were clever enough to fool your shell, etc. I think that Dennis Rockwell (duke!phs!dennis) got this working right once upon a time.)

----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen <jgoerzen@complete.org> of http://communication.ucsd.edu/A-News/

This Usenet Oldnews Archive article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.