[Libtorrent-devel] Using branch and if commands

Josef Drexler josef at ttdpatch.net
Fri Nov 28 14:39:57 UTC 2008


On Nov 28, 2008, at 1:17 PM, Pascal wrote:
>> Just one more question then, Is it possible to execute/run  
>> multiple commands in a branch?
>
> I tried some notations, but it seems that running multiple commands  
> in a
> branch is not possible. i.e. I tried to separate the commands with a
> semicolon but only the first is executed and the second is ignored.
> I think the only way is to execute a shell script which executes
> rtorrent commands via xmlrpc.


I don't know if there's any other way, but in 0.8.4 you can do it by  
defining a custom command ("macro" if you like) and calling that from  
the branch statement:

system.method.insert =  
my_print_command,simple,"print=one ;print=two ;print=three"
branch=d.get_custom1=,my_print_command=,print=four

That way you also avoid most of the quoting/escaping/bracing madness  
that you'd have to deal with to include quotes and spaces in a  
command argument.

-- 
Josef Drexler
josef at ttdpatch.net



More information about the Libtorrent-devel mailing list