On Fri, Jan 23, 2015 at 11:56:19AM +0000, Chris Green wrote:
> On Fri, Jan 23, 2015 at 01:41:57AM -0600, David Champion wrote:
> > * On 23 Jan 2015, Gary Johnson wrote: 
> > > >         #!/bin/sh
> > > >         COPY="$1.firefox.html"
> > > >     ln "$1" "$COPY"
> > > >     /usr/bin/firefox "$COPY" &
> > > 
> > > I'm surprised that linking works because it used to be that mutt
> > > overwrote the temporary file with 0s before deleting it.  I thought
> > > it still did, but I don't know for sure.
> > 
> > You're right, it does overwrite (at least for most cases).  I don't
> > think this was always true, but it's been a very long time since I used
> > mailcap this way, so I'm pretty distant.
> > 
> > So a hard link won't work.
> > 
> OK, so I'll copy the file, not a big problem.
> 
> If the copied file is put somewhere in /tmp then it'll get cleared
> away at the next reboot.

You should be able to "remove" it in the script that copies it and
starts firefox.  If more than a process has a file open and the
file is removed, only the directory entry is deleted.  The inode
and data blocks not freed until the last close is done.  So you
may be able to do something like:

  copy
  start firefox in background
  pause a second or two
  "remove" the copy
  exit (or issue a "wait" for firefox to complete)

Jon
-- 
Jon H. LaBadie                 j...@jgcomp.com
 11226 South Shore Rd.          (703) 787-0688 (H)
 Reston, VA  20190              (703) 935-6720 (C)

Reply via email to