Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3961 closed Bug (fixed)

Support for running scripts when a torrent finishes downloading on Windows

Reported by: rb07 Owned by: rb07
Priority: Normal Milestone:
Component: libtransmission Version: 2.13+
Severity: Normal Keywords: Windows
Cc:

Description

The changes since version 2.13 to this functionality use features unsupported on Windows (pipe(), SIGCHLD).

More interesting is: does the library really need pipe()? The included patch shows an alternative for Windows, where the script/program is executed asynchronously.

The terminology also is a bit wrong, its not only scripts, anything that is executable can be used. Since Windows has no shell, there are no shell scripts (do .bat files count as shell scripts?), but there are other scripts; I just mention this in case somebody says the functionality should be scraped altogether for builds that target Windows (I don't run anything, but if the library supports it, and the applications make it visible to the users, then it should be done right).

Attachments (1)

torrent.c.diff (1.2 KB) - added by rb07 5 years ago.
Adaptation to Windows.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by rb07

Adaptation to Windows.

comment:1 follow-up: Changed 5 years ago by jordan

the changes don't seem to use pipe(); do you mean fork() instead?

I'm adding your changes in for 2.20 beta 3. Thanks for the patch!

comment:2 Changed 5 years ago by jordan

  • Milestone None Set deleted
  • Owner changed from jordan to rb07

comment:3 Changed 5 years ago by jordan

  • Resolution set to fixed
  • Status changed from new to closed

jordan * r11786 libtransmission/torrent.c:

(trunk libT) #3961 "Support for running scripts when a torrent finishes downloading on Windows" -- fixed. patch by rb07

The changes to torrentCallScript() weren't portable to Windows, so rb07 has provided a patch.

comment:4 in reply to: ↑ 1 Changed 5 years ago by rb07

Replying to jordan:

the changes don't seem to use pipe(); do you mean fork() instead?

Yes, it is fork() that doesn't exist on Windows, pipe() does.

Note: See TracTickets for help on using tickets.