Hi there,
I was trying to modify the create plugin, because I want it to create torrents with ctorrent. I edited my conf.php as follows:
Code:
$useExternal = 'ctorrent';
Code:
$pathToCreatetorrent = '/usr/bin/ctorrent';
Then I created a bash script for ctorrent like for the other clients:
Code:
#!/bin/sh
#
# $1 - taskNo
# $2 - php
# $3 - ctorrent
# $4 - path
# $5 - piecesize
# $6 - user
dir=/tmp/"$6"$1
mkdir "$dir"
chmod a+rx "$dir"
echo $$ > "$dir"/pid
chmod a+r "$dir"/pid
"$3" -t -l $5 -u dummy "$4" -s "$dir"/temp.torrent 2> "$dir"/errors 1> "$dir"/log
last=$?
chmod a+r "$dir"/*
if [ $last -eq 0 ] ; then
echo 'Try to correct torrent file...' >> "$dir"/log
cd "$(dirname $0)"
"$2" ./correct.php $1 "$6" >> "$dir"/errors
last=$?
if [ $last -eq 0 ] ; then
echo 'Done.' >> "$dir"/log
else
echo 'Error.' >> "$dir"/log
fi
fi
echo $last > "$dir"/status
chmod a+r "$dir"/status
So far so good. But everytime I create a torrent it fails with this error message:
Code
X-Powered-By: PHP/5.2.6-1+lenny9
Content-type: text/html
<br />
<b>Warning</b>: file_put_contents(/var/www/rutorrent/share/users/rtor/torrents/Dumbo.Der.fliegende.Elefant.1941.German.1080p.BluRay.x264.PROPER-DETAiLS/.torrent) [<a href='function.file-put-contents'>function.file-put-contents</a>]: failed to open stream: No such file or directory in <b>/var/www/rutorrent/php/Torrent.php</b> on line <b>365</b><br />
Console log window:
Code:
Create hash table: 2076/2577
Create hash table: 2101/2577
Create hash table: 2126/2577
Create hash table: 2151/2577
Create hash table: 2176/2577
Create hash table: 2201/2577
Create hash table: 2226/2577
Create hash table: 2251/2577
Create hash table: 2276/2577
Create hash table: 2301/2577
Create hash table: 2326/2577
Create hash table: 2351/2577
Create hash table: 2376/2577
Create hash table: 2401/2577
Create hash table: 2426/2577
Create hash table: 2451/2577
Create hash table: 2476/2577
Create hash table: 2501/2577
Create hash table: 2526/2577
Create hash table: 2551/2577
Create hash table: 2576/2577
Create hash table: 2577/2577
create metainfo file /tmp/rtor1294092775/temp.torrent successful.
Try to correct torrent file...
Done.
Does anyone have an idea why this fails?
I was trying to modify the create plugin, because I want it to create torrents with ctorrent. I edited my conf.php as follows:
Code:
$useExternal = 'ctorrent';
Code:
$pathToCreatetorrent = '/usr/bin/ctorrent';
Then I created a bash script for ctorrent like for the other clients:
Code:
#!/bin/sh
#
# $1 - taskNo
# $2 - php
# $3 - ctorrent
# $4 - path
# $5 - piecesize
# $6 - user
dir=/tmp/"$6"$1
mkdir "$dir"
chmod a+rx "$dir"
echo $$ > "$dir"/pid
chmod a+r "$dir"/pid
"$3" -t -l $5 -u dummy "$4" -s "$dir"/temp.torrent 2> "$dir"/errors 1> "$dir"/log
last=$?
chmod a+r "$dir"/*
if [ $last -eq 0 ] ; then
echo 'Try to correct torrent file...' >> "$dir"/log
cd "$(dirname $0)"
"$2" ./correct.php $1 "$6" >> "$dir"/errors
last=$?
if [ $last -eq 0 ] ; then
echo 'Done.' >> "$dir"/log
else
echo 'Error.' >> "$dir"/log
fi
fi
echo $last > "$dir"/status
chmod a+r "$dir"/status
So far so good. But everytime I create a torrent it fails with this error message:
Code
X-Powered-By: PHP/5.2.6-1+lenny9
Content-type: text/html
<br />
<b>Warning</b>: file_put_contents(/var/www/rutorrent/share/users/rtor/torrents/Dumbo.Der.fliegende.Elefant.1941.German.1080p.BluRay.x264.PROPER-DETAiLS/.torrent) [<a href='function.file-put-contents'>function.file-put-contents</a>]: failed to open stream: No such file or directory in <b>/var/www/rutorrent/php/Torrent.php</b> on line <b>365</b><br />
Console log window:
Code:
Create hash table: 2076/2577
Create hash table: 2101/2577
Create hash table: 2126/2577
Create hash table: 2151/2577
Create hash table: 2176/2577
Create hash table: 2201/2577
Create hash table: 2226/2577
Create hash table: 2251/2577
Create hash table: 2276/2577
Create hash table: 2301/2577
Create hash table: 2326/2577
Create hash table: 2351/2577
Create hash table: 2376/2577
Create hash table: 2401/2577
Create hash table: 2426/2577
Create hash table: 2451/2577
Create hash table: 2476/2577
Create hash table: 2501/2577
Create hash table: 2526/2577
Create hash table: 2551/2577
Create hash table: 2576/2577
Create hash table: 2577/2577
create metainfo file /tmp/rtor1294092775/temp.torrent successful.
Try to correct torrent file...
Done.
Does anyone have an idea why this fails?