View Single Post

   
  #3 (permalink)  
Old 02-19-2008, 11:58 AM
Jesse F. Hughes
 
Posts: n/a
Default Re: Stupid question regarding btdownloadxterm.sh

Georg Neis <georg@fli4l.de> writes:

> * Jesse F. Hughes <jesse@phiwumbda.org> wrote:
>> I'd like to edit the file btdownloadxterm.sh so that it first copies
>> the torrent file to ~/BitTorrent and then calls xterm as it is. This
>> way, if I don't finish getting the file, I can later start up from the
>> command line rather than find the torrent via the browser a second
>> time.
>>
>> This should be trivial, but I just don't know how to send
>> btdownloadxterm.sh the file name for the torrent. If I had that, then
>> I could just do "cp $1 $filename".

>
> Actually, $1 _is_ the filename of the torrent file. Just add the
> following line (above the last line, of course):
>
> cp "$1" "$HOME"/BitTorrent


But it's the filename of the torrent file as it's saved now, which is
typically in a temporary location. That's not a very good filename
(even if I throw away the path and keep just the basename).

At the TV Torrents site, the torrent is served by a cgi-script. If I
choose to save the torrent, then Konqueror chooses a good name for
it. If I choose to call btdownloadxterm.sh, Konqueror chooses a
temporary file name for it and sends that file name to the script.

Konqueror must be getting the "good" name from *somewhere*, but I
can't guess where.

Thanks.
--
Jesse F. Hughes
"Of course, my ability to admit my mistakes and correct them is a
trait that many of you seem to never have properly appreciated."
-- JSH, discussing his 1463rd "proof" of Fermat's Last Theorem.
Reply With Quote