[Libtorrent-devel] Using branch and if commands

Steven Adams steve at drifthost.com
Sat Nov 29 12:17:10 UTC 2008


Thanks Josef, this will make things alot easier!

Josef Drexler wrote:
> 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.
>


More information about the Libtorrent-devel mailing list