From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5813 invoked from network); 3 Jun 1999 14:37:01 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Jun 1999 14:37:01 -0000 Received: (qmail 1972 invoked by alias); 3 Jun 1999 14:36:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6451 Received: (qmail 1965 invoked from network); 3 Jun 1999 14:36:35 -0000 Message-Id: <9906031408.AA18693@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: MAIL, MAILPATH and maildir support In-Reply-To: "Oliver Kiddle"'s message of "Thu, 03 Jun 1999 14:20:54 DFT." <37568136.2B496042@thoth.u-net.com> Date: Thu, 03 Jun 1999 16:08:48 +0200 From: Peter Stephenson Oliver Kiddle wrote: > Bart Schaefer wrote: > > > > Perhaps checkmailpath is a candidate for some kind of loadable module ... > > In my opinion, it would be useful to put all of the mail related > handling in a loadable module and then make that module quite powerful > (with lots of mush style commands etc). I think it would complement > stuff like the zftp module very well. I suggested writing such a module > about 2 years ago and got a mostly negative response. What does anyone > think? A module with more powerful mail commands is a reasonable idea, but I have some reservations. First, if this is going to be a largish add-on, basic UNIX mail-file checking (as it currently exists) should probably stay in the basic shell, since pretty much everybody (? I presume) uses that --- hence exporting it just gets you all the stuff in the module and doesn't in practice save anything. Second, with the plethora of mail systems (the maildir one is just one example), a general module for mail handling is a big undertaking. Third, anybody who wants to use individual commands rather than a monolothic program to get at the mail is probably well advised to use MH or some other existing system (the problem with mainting a connection that made zftp useful as a module doesn't exist). Nonetheless, if you've got some good ideas for what should go in such a module --- or even some code --- it would be interesting to see them. As for things like the patch that started all this: it looks to me like it could be written efficiently enough as a shell function to be run from one of the functions periodic or precmd. You could even divide it into two parts: first, shell code to replace the checkmailpath() functionality, which is pretty simple (apart from recursive directory checking, but you can use **/*(.mm???) to get regular files modified in the last ??? minutes --- maybe (ms???) should work too, but it doesn't at the moment); second, any ad-hoc functions to be called for special mail systems. The only difficulty with implementing mailstat() in that way is that looping over a lot of files is slow in zsh functions, but I don't think you need to: if you're just looking for the most recently modified/accessed file, *(om[1]) and *(oa[1]) are efficient (or will be when 3.1.6 appears), and if you want the total size (do you? checkmailpath() simply looks to see if it's non-zero), ls -l new/* cur/* | awk '{ tot += $5 } END { print tot }' works (maybe $4 for BSD). Such functions could certainly be distributed with the source. -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy