[Libtorrent-devel] "on_finished" order of execution

Max Killer hal.from.2001 at gmail.com
Tue Oct 6 17:45:20 UTC 2009


Suresh Kumar wrote:
> Hello List,
>
> On download finish, I need to move the file to a folder and create a symbolic link to it
> in another folder.
>
> So I have something like this in my rc file:
>
> ,----
> | on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,/media/data_storage/files/;d.set_directory=/media/data_storage/files/;create_link=base_filename,/media/data_storage/download_finished/,"
> `----
>
> Moving works fine, but the link created points to the location that
> was before the move. 
>
> This more or less looks like an out of order execution case. 
> (Or I will have to update a variable after moving?)
>
> Any tip on how to fix this issue?
>
> Thanks,
> Suresh
>
> PS: I even tried putting them in two separate commands but that didn't
> help either.
>
> ,----
> | on_finished = zlink1,"create_link=base_filename,/media/data_storage/download_finished/,"
> | on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,/media/data_storage/Movies/files/;d.set_directory=/media/data_storage/Movies/files/"
> `----
>   
Hello,

I have solved your problem before if I understand you correctly.

Use:
system.method.set_key = 
event.download.finished,test3,"execute=/home/XXXXX/bin/process_torrent,$d.get_base_path=,stopped;d.set_directory=/home/XXXXX/data/incoming/symlinks/"

The symlink is set in the script "process_torrent".

Good luck,

Max


More information about the Libtorrent-devel mailing list