Aleksey Yashchenko | 4 Oct 2011 01:21
Picon
Gravatar

File sharing problem

Hello all!

Trying to share two files from disk root in Windows.
Say:
D:\File1.txt
D:\File2.txt

Have path assertions either from file_storage or from piece hasher.

Any ideas?

Thanks!

~Leha
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
arvid | 4 Oct 2011 02:14
Picon
Picon
Favicon

Re: File sharing problem

Quoting Aleksey Yashchenko <tuxslayer <at> gmail.com>:

> Hello all!
> 
> Trying to share two files from disk root in Windows.
> Say:
> D:\File1.txt
> D:\File2.txt
> 
> Have path assertions either from file_storage or from piece hasher.
> 
> Any ideas?

You can only create a single-file torrent or a multi-file torrent with a shared
root (i.e. essentially a single folder with the files in it).

This is because of the assumed directory multi-file torrents are downloaded
into, which is the name of the torrent, to make the create torrent case match
the seed torrent case.

--

-- 
Arvid Norberg

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
(Continue reading)

Aleksey Yashchenko | 4 Oct 2011 10:22
Picon
Gravatar

Re: File sharing problem

Oh,.. I see.
So, I am creating multi-file torrent with a shared root (D:\) and it is not
working.

I've also tried to use rename_file with this but no results either.

~Leha

2011/10/4 <arvid <at> cs.umu.se>

> Quoting Aleksey Yashchenko <tuxslayer <at> gmail.com>:
>
> > Hello all!
> >
> > Trying to share two files from disk root in Windows.
> > Say:
> > D:\File1.txt
> > D:\File2.txt
> >
> > Have path assertions either from file_storage or from piece hasher.
> >
> > Any ideas?
>
> You can only create a single-file torrent or a multi-file torrent with a
> shared
> root (i.e. essentially a single folder with the files in it).
>
> This is because of the assumed directory multi-file torrents are downloaded
> into, which is the name of the torrent, to make the create torrent case
> match
(Continue reading)

arvid | 4 Oct 2011 17:57
Picon
Picon
Favicon

Re: File sharing problem

Quoting Aleksey Yashchenko <tuxslayer <at> gmail.com>:

> Oh,.. I see.
> So, I am creating multi-file torrent with a shared root (D:\) and it is not
> working.

The 'name' of the torrent is inferred from the paths of the files you add. Is
your intention to create a torrent whose name is "D"? The root name is not
considered a directory.

> I've also tried to use rename_file with this but no results either.

If you add the files with names where they don't exist (but have a shared root
directory) you should be able to rename them before you calculate the hashes.
Something like:

   file_storage s;
   s.add_file("d:\\torrent_name\\file1.txt", filesize1);
   s.add_file("d:\\torrent_name\\file2.txt", filesize2);

   s.rename_file(0, "..\\file1.txt");
   s.rename_file(1, "..\\file2.txt");

   create_torrent c(s);
   set_piece_hashes(c, "d:\\");
   entry e = c.generate();

Is that what you tried?

--

-- 
(Continue reading)

Aleksey Yashchenko | 4 Oct 2011 18:10
Picon
Gravatar

Re: File sharing problem

Oh... I've tried nearly the opposite, thanks! I'll check this :)

~Leha

2011/10/4 <arvid <at> cs.umu.se>

> Quoting Aleksey Yashchenko <tuxslayer <at> gmail.com>:
>
> > Oh,.. I see.
> > So, I am creating multi-file torrent with a shared root (D:\) and it is
> not
> > working.
>
> The 'name' of the torrent is inferred from the paths of the files you add.
> Is
> your intention to create a torrent whose name is "D"? The root name is not
> considered a directory.
>
> > I've also tried to use rename_file with this but no results either.
>
> If you add the files with names where they don't exist (but have a shared
> root
> directory) you should be able to rename them before you calculate the
> hashes.
> Something like:
>
>   file_storage s;
>   s.add_file("d:\\torrent_name\\file1.txt", filesize1);
>   s.add_file("d:\\torrent_name\\file2.txt", filesize2);
>
(Continue reading)

Aleksey Yashchenko | 7 Oct 2011 11:40
Picon
Gravatar

Re: File sharing problem

It works as for torrent creation, however, then libtorrent tries to read
file at
d:\\torrent_name\\file1.txt
when remote peer connecting and asking for data.
I can see this path in alerts with file read error.

~Leha

2011/10/4 Aleksey Yashchenko <tuxslayer <at> gmail.com>

> Oh... I've tried nearly the opposite, thanks! I'll check this :)
>
> ~Leha
>
>
>
> 2011/10/4 <arvid <at> cs.umu.se>
>
> Quoting Aleksey Yashchenko <tuxslayer <at> gmail.com>:
>>
>> > Oh,.. I see.
>> > So, I am creating multi-file torrent with a shared root (D:\) and it is
>> not
>> > working.
>>
>> The 'name' of the torrent is inferred from the paths of the files you add.
>> Is
>> your intention to create a torrent whose name is "D"? The root name is not
>> considered a directory.
>>
(Continue reading)

arvid | 7 Oct 2011 19:17
Picon
Picon
Favicon

Re: File sharing problem

Quoting Aleksey Yashchenko <tuxslayer <at> gmail.com>:

> It works as for torrent creation, however, then libtorrent tries to read
> file at
> d:\\torrent_name\\file1.txt
> when remote peer connecting and asking for data.
> I can see this path in alerts with file read error.

Yeah, you need to rename the files when you load it as well, since they don't
exist where libtorrent would download them.

You can do this on the object returned from torrent_info::files().

--

-- 
Arvid Norberg

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
Miha Verlic | 10 Oct 2011 17:15

Slow(er) rehash speeds with libtorrent 0.15.x

Hello,

after upgrading to latest Deluge (and to libtorrent-0.15.x), I started
to notice rehash speeds dropped by a factor of two. After some testing,
it seems to be related to libtorrent version I use - with 0.14.12 rehash
speed is roughly 45MB/s on RAID5 (MD) device, with 0.15.x the speed is
crippled to 22,7MB/s, with double read request ratio. It seems 0.15.x is
issuing a lot more (and smaller) read requests (1357/s) than 0.14.x
(702/s). Is there any way to fix this or restore previous behaviour?

Some iostat statistics - I was re-hashing 4gb file in Deluge (2MB chunk
size) and before each test I flushed VFS cache:

with deluge 1.3.3 + libtorrent-0.15.6 - 21,7MB/s
Device: rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz
avgqu-sz   await  svctm  %util
sda       1.01     0.00  456.42    1.01  7302.70     4.05    31.95
0.28    0.62   0.51  23.14
sdb       0.00     0.00  454.56    1.01  7264.86     4.05    31.91
0.27    0.60   0.51  23.34
sdc       0.42     0.00  456.33    0.93  7288.51     3.72    31.90
0.31    0.67   0.54  24.83
md4       0.00     0.00 1357.18    0.00 21714.86     0.00    32.00
0.00    0.00   0.00   0.00

with deluge 1.3.3 + libtorrent-0.14.12 - 44,9MB/s
Device: rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz
avgqu-sz   await  svctm  %util
sda      53.21     0.09  181.57    0.63 14981.39     2.89   164.48
0.86    4.72   2.98  54.24
(Continue reading)

Aleksey Yashchenko | 10 Oct 2011 17:18
Picon
Gravatar

Re: File sharing problem

I.e. if I understand right, just in order to share two files (or folders)
from drive root I need to add this rename logic on torrent creation, then
remember, that rename took place, and on each torrent load rename files
again...
Looks a bit complex.

~Leha

2011/10/7 <arvid <at> cs.umu.se>

> Quoting Aleksey Yashchenko <tuxslayer <at> gmail.com>:
>
> > It works as for torrent creation, however, then libtorrent tries to read
> > file at
> > d:\\torrent_name\\file1.txt
> > when remote peer connecting and asking for data.
> > I can see this path in alerts with file read error.
>
> Yeah, you need to rename the files when you load it as well, since they
> don't
> exist where libtorrent would download them.
>
> You can do this on the object returned from torrent_info::files().
>
> --
> Arvid Norberg
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
(Continue reading)

arvid | 11 Oct 2011 05:07
Picon
Picon
Favicon

Re: File sharing problem

Quoting Aleksey Yashchenko <tuxslayer <at> gmail.com>:

> I.e. if I understand right, just in order to share two files (or folders)
> from drive root I need to add this rename logic on torrent creation, then
> remember, that rename took place, and on each torrent load rename files
> again...
> Looks a bit complex.

.torrent files don't support having multiple files not contained in a root
folder.

Here's a reference to why that might actually be a good thing:

   http://en.wikipedia.org/wiki/Tar_(file_format)#Tarbomb

--

-- 
Arvid Norberg

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct

Gmane