Re: viewing attachments with identical filenames

2015-12-07 Thread Peter P.
* Arkadiusz Drabczyk  [2015-11-19 18:11]:
> On 2015-11-18, Peter P.  wrote:
> > Hi list,
> >
> > I came across an annoying issue when viewing attached files in mutt.
> > In order to view attachment "A" Mutt saves the file to /tmp/mutt and
> > launches the appropriate viewer. When I want to see another attachment
> > "B" which has an identical filename as "A" and ask mutt to display it,
> > mutt will not overwrite the already stored "A" file in /tmp/mutt, and
> > hence display "A" while I would expect to see "B".
> >
> > Is this a known issue, and could there be a workaround to this?
> 
> I must be missing something.  Mutt saves temporary files to $TMPDIR or
> to /tmp if $TMPDIR is unset (TMPDIR is kinda standard
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03).
> Did you set your $TMPDIR to /tmp/mutt?  
I have not set $TMPDIR nor tmpdir in .muttrc but have the following line
in my .mailcap:

application/*; mkdir -p /tmp/mutt \; cp %s /tmp/mutt/ \; xdg-open 
/tmp/mutt/$(basename %s) 2>/dev/null &

I found that the attachment file is given read-only permissions by the
above copy command, and cannot really reproduce why.

By adding the -f (force) option to cp I managed to have the old
attachment file overwritten. I am curious about why the file referenced
in %s above has only read permissions in the first hand place.

But then I wonder if there is a better/more elegant way of doing
this in .mailcap in the first hand place.

Thank you for your advice,

cheers, P


Re: viewing attachments with identical filenames

2015-11-19 Thread Arkadiusz Drabczyk
On 2015-11-18, Peter P.  wrote:
> Hi list,
>
> I came across an annoying issue when viewing attached files in mutt.
> In order to view attachment "A" Mutt saves the file to /tmp/mutt and
> launches the appropriate viewer. When I want to see another attachment
> "B" which has an identical filename as "A" and ask mutt to display it,
> mutt will not overwrite the already stored "A" file in /tmp/mutt, and
> hence display "A" while I would expect to see "B".
>
> Is this a known issue, and could there be a workaround to this?

I must be missing something.  Mutt saves temporary files to $TMPDIR or
to /tmp if $TMPDIR is unset (TMPDIR is kinda standard
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03).
Did you set your $TMPDIR to /tmp/mutt?  Anyway, I cannot reproduce
this behavior - I sent two identically named .pdf files, opened them
in turn and both of them were saved to $TMPDIR before opening and
handled by mutt in accordance with ~/.mailcap.  What mutt version do
you use?  I tested it on both 1.5.21 and 1.5.24.

-- 
Arkadiusz Drabczyk 



viewing attachments with identical filenames

2015-11-18 Thread Peter P.
Hi list,

I came across an annoying issue when viewing attached files in mutt.
In order to view attachment "A" Mutt saves the file to /tmp/mutt and
launches the appropriate viewer. When I want to see another attachment
"B" which has an identical filename as "A" and ask mutt to display it,
mutt will not overwrite the already stored "A" file in /tmp/mutt, and
hence display "A" while I would expect to see "B".

Is this a known issue, and could there be a workaround to this?

Thank you so much!
P