Ticket #104 (new defect)

Opened 2 years ago

Last modified 2 months ago

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

Reported by: anonymous Assigned to: yllar
Priority: major 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

05/29/08 06:17:45 changed 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.

05/29/08 18:32:45 changed 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?

05/30/08 21:09:32 changed by anonymous

Any help?

05/31/08 00:05:27 changed 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.

05/31/08 18:36:08 changed 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

05/31/08 18:36:53 changed 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

05/31/08 18:44:38 changed 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.

05/31/08 21:33:56 changed by greg@loscombe.com

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

12/01/08 10:36:23 changed 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.

12/11/08 01:09:12 changed by anonymous

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

01/18/09 02:18:17 changed 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

01/18/09 18:15:46 changed by cky

  • status changed from closed to reopened.
  • resolution 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 directory/quote

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

Please help.

02/07/09 22:43:32 changed 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

02/24/09 12:30:21 changed 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!

05/03/09 02:32:05 changed 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

08/01/09 00:35:11 changed 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.

08/08/09 22:44:48 changed 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.

10/18/09 19:45:28 changed by yllar

  • owner changed from royger to yllar.
  • status changed from reopened to new.

12/28/09 04:15:18 changed by Drivers Download

Notebook Drivers Download. All notebook for Acer, Apple, ASmobile, Asus, BenQ, Dell, Fujitsu, Gateway, HP, IBM, Lenovo, LG, MSI, SONY, Panasonic, Samsung, Toshiba have been listed in Best Drivers Download. Drivers for notebook have been categorized by device manufacturers.


Add/Change #104 (Error: Impossible to create file on given directory, please check permisions)