Modify

Ticket #104 (assigned defect)

Opened 2 years ago

Last modified 2 months ago

Error: Impossible to create file on given directory, please check permisions

Reported by: anonymous Owned by: iamacarpetlicker
Priority: major Milestone: Current - Refresh
Component: wTorrent Version:
Keywords: Cc:

Description

I've done this, for the sake of testing:

mkdir /test; chown www-data:www-data /test; chmod 777 /test

So, /test/ is 777.

Trying to upload a torrent and telling it to download to "/test/" gives me: Error: Impossible to create file on given directory, please check permisions

Thanks for all your very responsive help so far. You've solved/answered all questions :)

Attachments

Change History

comment:1 Changed 2 years ago by royger

wTorrent is referring to the torrents folder, not the place where you save your data. You must chmod 777 the folder called torrents inside wtorrent.

comment:2 Changed 2 years ago by anonymous

My DIR_TORRENTS isn't set to the default "torrents/".

It's set to /test/ , which is chown www-data:www-data /test; chmod 777 /test

Does DIR_TORRENTS still use "torrents/" even though I told it not to?

comment:3 Changed 2 years ago by anonymous

Any help?

comment:4 Changed 2 years ago by royger

Sorry for the delay. I've just released that you are not able to change the folder of downloaded torrents to one outside the wtorent folder. For example, if you set your DIR_TORRENTS to /test/ wTorrent will try to use the folder /path/to/wtorrent/test (you just changed the folder 'torrents' for 'test').
If you want to fix this, open wtorrent/home/cls/AddT.cls.php and change every occurrence of:
DIR_EXEC . DIR_TORRENTS
with:
DIR_TORRENTS
I haven't tested it, but I think this should work.

comment:5 Changed 2 years ago by anonymous

Fantastic! Thanks, royger.

To anyone else this effects, here's a copy/paste fix. Of course, set $WTORRENT to whatever your dir is.

WTORRENT=/var/www/wtorrent cp $WTORRENT/home/cls/AddT.cls.php $WTORRENT/home/cls/AddT.cls.php.original sed 's/DIR_EXEC . DIR_TORRENTS/DIR_TORRENTS/g' \

$WTORRENT/home/cls/AddT.cls.php.original > $WTORRENT/home/cls/AddT.cls.php

comment:6 Changed 2 years ago by anonymous

Er, I forgot Trac doesn't like code unless it's in a code block. Here it is again. Don't use the above.

WTORRENT=/var/www/wtorrent
cp $WTORRENT/home/cls/AddT.cls.php $WTORRENT/home/cls/AddT.cls.php.original
sed 's/DIR_EXEC . DIR_TORRENTS/DIR_TORRENTS/g' $WTORRENT/home/cls/AddT.cls.php.original \
 > $WTORRENT/home/cls/AddT.cls.php

comment:7 Changed 2 years ago by royger

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

I don't know if many more people is interested in this, if so I will try to change this behaviour in future releases.

comment:8 Changed 2 years ago by greg@…

Would be good if we could change the location. Personally, I wanted this...

/home/torrents/finished <--- rtorrent DL dir /home/torrents/watched <--- rtorrent watch location

And was going to set DIR_TORRENTS to be the same as my watch dir, so if I reboot the machine, the torrents will start back up again when I start rtorrent.

Had me puzzled for a bit.

Thanks

comment:9 Changed 21 months ago by buglis

Hi, i want change this file into last version of wtorrent but i don't find the file to fix, can i have a help? Thanks.

comment:10 Changed 21 months ago by anonymous

Fixed whit /torrent and chmod 777 (example: /var/www/wtorrent/torrent/) and it Works!

comment:11 Changed 20 months ago by Martin

Just a note:

This still affects the newest wtorrent revisions. However, the files have moved around since the fixes posted above. You now need to change every occurrence of "DIR_EXEC . DIR_TORRENTS" to "DIR_TORRENTS" in the file "*wtorrent_directory*/wt/cls/AddT.cls.php". The copy-paste fix mentioned above is now (remember to change what comes after "WTORRENT=" if wtorrent is in a different directory):

WTORRENT=/var/www/wtorrent
cp $WTORRENT/wt/cls/AddT.cls.php $WTORRENT/wt/cls/AddT.cls.php.original
sed 's/DIR_EXEC . DIR_TORRENTS/DIR_TORRENTS/g' $WTORRENT/wt/cls/AddT.cls.php.original \
 > $WTORRENT/wt/cls/AddT.cls.php

comment:12 Changed 20 months ago by cky

  • Status changed from closed to reopened
  • Resolution fixed deleted

I can't fix this problem no matter what.

This is what i do: [quote]rtorrent@ckyserver:~/public_html$ cp /home/rtorrent/public_html/wt/cls/AddT.cls.php /home/rtorrent/public_html/wt/cls/AddT.cls.php.original rtorrent@ckyserver:~/public_html$ sed '/home/rtorrent/public_html/ . /home/rtorrent/torrents/' /home/rtorrent/public_html/wt/cls/AddT.cls.php.original \ > /home/rtorrent/public_html/wt/cls/AddT.cls.php sed: ni moĹžno prebrati: No such file or directoryquote

And no matter what, if I have it in /var/www or in public_html...

Please help.

comment:13 Changed 19 months ago by anonymous

try using

WTORRENT=/var/www/
cp $WTORRENT/wt/cls/AddT.cls.php $WTORRENT/wt/cls/AddT.cls.php.original
sed 's/DIR_EXEC . DIR_TORRENTS/DIR_TORRENTS/g' $WTORRENT/wt/cls/AddT.cls.php.original \
 > $WTORRENT/wt/cls/AddT.cls.php

its the same thing, only for ubuntu or debian guide install tested and working on all new

comment:14 Changed 19 months ago by anonymous

I am having this same problem with permissions. I followed the directions above (edited the file by hand instead of copy and past fix) and now everything seems to work.

Thanks for figuring this out guys!

comment:15 Changed 16 months ago by Yonzie

diff fix:

--- AddT.cls.php.original	2009-05-03 03:19:02.000000000 +0200
+++ AddT.cls.php	2009-05-03 03:19:39.000000000 +0200
@@ -54,7 +54,7 @@
 
 		// Parsing url
 		$purl = parse_url($url);
-		$uploadfile = DIR_EXEC . DIR_TORRENTS . sha1( $url ) . md5($url) . ".torrent";
+		$uploadfile = DIR_TORRENTS . sha1( $url ) . md5($url) . ".torrent";
 		// Get sha1/md5 for avoid filename problems & Multiple torrents
 		if (file_exists($uploadfile))
 		{ 
@@ -165,8 +165,8 @@
 		{
 			$dir = $this->getDir();
 		}
-		$uploadfile = DIR_EXEC . DIR_TORRENTS . time() . basename($fileU['name']);
-		if (!is_writable(DIR_EXEC . DIR_TORRENTS))
+		$uploadfile = DIR_TORRENTS . time() . basename($fileU['name']);
+		if (!is_writable(DIR_TORRENTS))
 		{
 			$this->addMessage($this->_str['err_add_dir']);
 			return false;

For those who don't know diff, put the above in a text file (AddT.diff or something) in the same directory as the offending file (./tw/cls/AddT.diff) then do

patch < AddT.diff

comment:16 Changed 13 months ago by anonymous

This patch should be applied in trunk.

At least make it more clear that all torrent/download dirs must go within the wtorrent root!

A lot of us also want to use paths outside of the wt root.

Thank you.

comment:17 Changed 13 months ago by wtorrent newbie

I have been using rtorrent for a bit, and decided I wanted the WebUI convenience of wtorrent. It took me some time, but it's finally all working, and my last hurdle was what you discussed here. Thanks SO much for the fixes. I'm not great in Linux yet, and this really saved me some frustration.

comment:18 Changed 11 months ago by yllar

  • Owner changed from royger to yllar
  • Status changed from reopened to new

comment:19 Changed 2 months ago by iamacarpetlicker

  • Owner changed from yllar to iamacarpetlicker
  • Status changed from new to assigned
  • Milestone set to 2010 Refresh

I'll try and get this merged into the code.

Will just have to make sure it finds the current directory of wTorrent and presents it as default on install.

View

Add a comment

Modify Ticket

Action
as assigned
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.