<<< Date Index >>>     <<< Thread Index >>>

Re: Header-Cache problem with cache size



On Tue, Oct 05, 2004 at 11:31:10AM +0200, Michelle Konzack quoth:
> It is goog and useful, that the $USER can select where he/she like to
> have it. But if I use for example a Directory like
> 
>     set header_cache=/tmp/mutt-michelle/
> 
> I must create every time the Directory by my self...
> I think, it is not a great deal, to do it within mutt automaticly.

Ahh, but you must be unaware of one of mutt's coolest features. Within a 
muttrc, any string can be replaced with SHELL COMMANDS that output the 
string you want. I'll give you an example in just a moment.

> On the otherside if I have a global muttrc, because I have an Internet
> Cafee where the $HOME is on NFS too, it can not be used anymore, 
> because it try to put all cachefiles in the same directory.
> 
> Or what is, if I have two or more $USER, which try to use the same name,
> for example
> 
>     set header_cache=/tmp/hcache

So, include the user name. Using the shell in your muttrc, you could do 
it something like this:

   set header_cache=/tmp/hcache-`whoami`

or
   set header_cache=/tmp/hcache-`echo $USER`

> then you run into trouble too. I think, it is enough, if the $USER can
> choose between /tmp and $HOME which sould create directories like
> 
>     /tmp/mutt-hcache-<login>
> or
>     $HOME/.mutt-hcache/

You could simply allow the user to include a local directory---using the 
same trick above. For example:

`test -r ~/.mutt_hcacherules && echo source ~/.mutt_hcacherules`

(this gets more interesting if the .mutt_hcacherules doesn't exist, 
because then mutt is expecting a string where it doesn't find one. 
Currently I solve this problem with a hack: if the file doesn't exist, I 
push a benign command:

`test -r ~/.mutt_hcacherules && echo source ~/.mutt_hcacherules || echo 
push "*"`

> To determie whether it is a file or directory based hcache, maybe ad
> 
>     set header_cache_type=file|dir
> and
>     set header_cache=tmp|home

Mmm... seems a little complicated to me.

~Kyle
-- 
Scientists have shown that the moon is moving away at a tiny, although
measurable distance from earth every year. If you do the math, you can
calculate that 65 million years ago, the moon was orbiting at a distance
of about 35 feet from the earth's surface. This would explain the death of
the dinosaurs . . . the tallest ones, anyway.
-- Unknown

Attachment: signature.asc
Description: Digital signature