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

Re: Save multiple attachements at once. [patch]



I just tried this out w/1.5.6i - very nice.  But, if you didn't know
the facility was there (like me!), you'd never try it.  

Thanks for getting this in the release, and for the pointer!

d

At 15:48:00, on 03.04.04:
Christoph Berg seeped these bits into my brain:,
> Re: Bill Moseley in <20040303210719.GA2455@xxxxxxxx>
> > > What if you want to save all the attachments with their original
> > > filenames in a different directory from your working directory?
> > 
> > Yes, that was the question.  I get sent a collection of attachements and
> > I want quickly dump all 200 of them into a single (likely new)
> > directory.
> 
> The ability to save to a directory was introduced about ~2 months ago,
> so check out Mutt 1.5.x (x >= ~5).
> 
> You still have to press <enter> to confirm every filename even if you've
> answered "(a)ll". The following patch saves all attachments without
> re-asking for each file:
> 
> RCS file: /home/roessler/cvs/mutt/recvattach.c,v
> retrieving revision 3.12
> diff -u -r3.12 recvattach.c
> --- recvattach.c      4 Oct 2003 20:35:00 -0000       3.12
> +++ recvattach.c      4 Mar 2004 14:33:04 -0000
> @@ -384,15 +384,18 @@
>         body->encoding != ENCQUOTEDPRINTABLE &&
>         mutt_is_message_type(body->type, body->subtype))
>      mutt_default_save(buf, sizeof(buf), body->hdr);
> +  else if (directory && *directory)
> +    strfcpy (buf, *directory, sizeof (buf));
>    else
>      buf[0] = 0;
>  
>    prompt = _("Save to file: ");
>    while (prompt)
>    {
> -    if (mutt_get_field (prompt, buf, sizeof (buf), M_FILE | M_CLEAR) != 0
> -     || !buf[0])
> -      return -1;
> +    if (!directory || !*directory || !body->filename || !*body->filename)
> +      if (mutt_get_field (prompt, buf, sizeof (buf), M_FILE | M_CLEAR) != 0
> +       || !buf[0])
> +     return -1;
>      
>      prompt = NULL;
>      mutt_expand_path (buf, sizeof (buf));
> 
> Christoph
> -- 
> cb@xxxxxxxx | http://www.df7cb.de/


-- 
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
"I distrust those people who know so well what God
wants them to do, because I notice it always coincides
with their own desires."     -- Susan B. Anthony.
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*