On Wed, Sep 19, 2001 at 03:53:27PM -0400, Jean-Sebastien Morisset wrote:
> > wrap the call to lynx in a shell script that hardlinks the file to a
> > different name, and removes the file when the script is done.
> 
> No can do. Lynx creates a temporary filename which is deleted as lynx
> exits - which is right after downloading the image. :-)

lynx uses an external viewer for the image, which can be a shell script
that determines the filename and manipulates it appropriately, e.g.,

in lynx.cfg (actually I define $LYNX_CFG to be a private file):

XLOADIMAGE_COMMAND:my-viewer xli %s &

script my-viewer

#!/bin/sh
# $1 is viewer
# $2 is filename
chmod 600 $2
myfile=`echo $2 | sed -e 's@\(.*/tmp/\)\([^/]*/\)\?\(.*\)@\1my\3@'`
ln $2 $myfile || exit 1
trap "rm -f $myfile" 0 1 2 5 15
eval $1 $myfile

-- 
Thomas E. Dickey <[EMAIL PROTECTED]>
http://invisible-island.net
ftp://invisible-island.net

Reply via email to