Mozy Online Backup: 2GB Free. Automatic. Secure.
Subject: RE: Create torrent for a single file folder - msg#00016
List: network.bit-torrent.libtorrent
Yeah it worked, thank you Arvid!
>
-----Original Message-----
>
From: libtorrent-discuss-admin@xxxxxxxxxxxxxxxxxxxxx
[
mailto:libtorrent-
>
discuss-admin@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Arvid Norberg
>
Sent: Wednesday, May 11, 2005 7:04 PM
>
To: libtorrent-discuss@xxxxxxxxxxxxxxxxxxxxx
>
Subject: Re: [libtorrent] Create torrent for a single file folder
>
>
Liu Shuai wrote:
>
> Hi,
>
>
>
> I am trying to create a torrent for a folder (c:\foo) that has only
one
>
> file (bar)
>
> I followed the maketorrent example and it works just fine when I
pass in
>
>
>
> "c:\foo\bar" as the full path.
>
>
>
> However when I choose c:\foo as the full path, libtorrent creates a
>
> torrent that has "foo/bar" as the name in the info dictionary
instead of
>
> "foo". And the torrent file is not accepted by clients like ABC or
>
> Mainline (Mainline gives error "name foo/bar disallowed for security
>
> reasons) and Azureus actually tries to save the file as
>
> DOWNLOAD_DIR\foo_bar instead of DOWNLOAD_DIR\foo\bar
>
>
>
> Would it possible to make the torrent using "foo" as name and put
"bar"
>
> into "files" list, like the way Azureus does?
>
>
Oh, I didn't think of this case when I wrote that. I was thinking
>
"single-file torrent" and "multi-file torrent".
>
>
The fix for this had bigger implications than I first expected. I used
>
to use
>
>
torrent_info::num_files() > 1
>
>
to identify if the torrent's name should be prepended to the file
paths.
>
But since that is incorrect, I have changed the path entry in the
>
file_entry in the iterators of torrent_info to be the full path (well,
>
the full relative path). I also found a few security issues where
names
>
with paths were accepted in name and where .. was accepted in file
paths.
>
>
Please confirm that the new behavior of the torrent_info meets your
>
expectations.
>
>
--
>
Arvid Norberg
>
>
>
-------------------------------------------------------
>
This SF.Net email is sponsored by Oracle Space Sweepstakes
>
Want to be the first software developer in space?
>
Enter now for the Oracle Space Sweepstakes!
>
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
>
_______________________________________________
>
Libtorrent-discuss mailing list
>
Libtorrent-discuss@xxxxxxxxxxxxxxxxxxxxx
>
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&op=click
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: how to support selection download
I tried to remove the actual allocation of pieces (where zeroes are
written to the files) but that turned out not to work. My assert that
tell() say the same thing as I pass to seek() failed. This is on darwin
(osx).
On Windows there is a SetEndOfFile() function. Dokumentation says it will
truncate or extend the file to the file pointer position and the content
will be undefined. Very likely other os's will have this too. I guess you
have to call this function before before tell() will work.
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
Next Message by Date:
click to view message preview
where is the torrent rss Specification?
can somebody give me the link?
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
Previous Message by Thread:
click to view message preview
Re: Create torrent for a single file folder
Liu Shuai wrote:
Hi,
I am trying to create a torrent for a folder (c:\foo) that has only one
file (bar)
I followed the maketorrent example and it works just fine when I pass in
"c:\foo\bar" as the full path.
However when I choose c:\foo as the full path, libtorrent creates a
torrent that has "foo/bar" as the name in the info dictionary instead of
"foo". And the torrent file is not accepted by clients like ABC or
Mainline (Mainline gives error "name foo/bar disallowed for security
reasons) and Azureus actually tries to save the file as
DOWNLOAD_DIR\foo_bar instead of DOWNLOAD_DIR\foo\bar
Would it possible to make the torrent using "foo" as name and put "bar"
into "files" list, like the way Azureus does?
Oh, I didn't think of this case when I wrote that. I was thinking
"single-file torrent" and "multi-file torrent".
The fix for this had bigger implications than I first expected. I used
to use
torrent_info::num_files() > 1
to identify if the torrent's name should be prepended to the file paths.
But since that is incorrect, I have changed the path entry in the
file_entry in the iterators of torrent_info to be the full path (well,
the full relative path). I also found a few security issues where names
with paths were accepted in name and where .. was accepted in file paths.
Please confirm that the new behavior of the torrent_info meets your
expectations.
--
Arvid Norberg
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
Next Message by Thread:
click to view message preview
how to support selection download
how can we do with libtorrent?
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.