Thanks a lot for that, Josef.

And how would it work with additional arguments, for example "date --utc"?

xmlrpc localhost branch E385AFEBE0BFC0111533C0A4E9036281064287E6
system.pid= 'd.set_custom1=$execute_capture=date,--utc'
Error: RPC failed at server.  Not a string. (-503)

xmlrpc localhost branch E385AFEBE0BFC0111533C0A4E9036281064287E6
system.pid= 'd.set_custom1=\"$execute_capture=date,--utc\"'
Error: RPC failed at server.  Not a string. (-503)

Joost

> On Jul 18, 2009, at 11:53 AM, Joost wrote:
>> I'm using RTorrent 0.8.5, and trying to use the execute_capture
>> command.
>> So far I'm unable to capture output of any command. Below is a list
>> of (a
>> few of) my trials ('xmlrpc localhost' precedes each rtorrent
>> command) in
>> which I want to put the output of the /bin/date command into the
>> custom1
>> variable:
>>
>> d.set_custom1 'E385AFEBE0BFC0111533C0A4E9036281064287E6' "test"
>> d.get_custom1 'E385AFEBE0BFC0111533C0A4E9036281064287E6'
>> Result: String: 'test'
>>
>> jo...@nslu2:~/rtorrent_xmlrpc$ /bin/date
>> Sat Jul 18 11:35:46 CEST 2009
>>
>> d.set_custom1 'E385AFEBE0BFC0111533C0A4E9036281064287E6'
>> "$execute_capture=/bin/date"
>> d.get_custom1 'E385AFEBE0BFC0111533C0A4E9036281064287E6'
>> Result: String: '=/bin/date'
>
>
> If you entered that in a shell, it will have expanded
> $execute_capture as if it was a non-existant environment variable.
> Use single quotes instead of double quotes or escape the $ with a
> backslash.
>
> Though I don't think rtorrent supports the $ at the start of xmlrpc
> arguments. I've only found a hack to do this, using "branch" with a
> fake, always true condition:
>
> xmlrpc localhost branch A5DA68DDA610B96CE2E585797A598328191FA4E9
> system.pid= 'd.set_custom1=$execute_capture=date'
>
> Also note that rtorrent 0.8.5 allows you to use more than the 1-5
> custom strings, for instance: d.set_custom=date_string,
> $execute_capture=date and then d.get_custom=date_string
>
> That avoids collisions with other things because you can use a
> specific, arbitrary key for your task.
>
> --
> Josef Drexler
> jo...@ttdpatch.net
>

_______________________________________________
Libtorrent-devel mailing list
Libtorrent-devel@rakshasa.no
http://rakshasa.no/mailman/listinfo/libtorrent-devel

Reply via email to