1 Apr 2009 14:00
create_torrent multifile
Sergey A. Proforov <snatch <at> agava.com>
2009-04-01 12:00:45 GMT
2009-04-01 12:00:45 GMT
Hello, I have some problems with creating torrent.
I want to create torrent and start seeding it immediately.
1) If I create torrent with one file, it is all right. If I create
multifile torrent, and try to open it, "invalid torrent file"
exception is thrown, while parsing torrent. uTorrent also can't open it.
All files are placed in same directory.
m_root = tpath( *m_files.begin() ).branch_path();
file_storage fs;
for( files_coll::iterator i = m_files.begin(); i != m_files.end(); ++i )
{
add_files( fs, *i );
}
int piece_size = 16*1024; //16 KB
create_torrent t( fs, piece_size );
set_piece_hashes( t, m_root, &CDlgCreateTorrent::PieceCallBack );
...
std::ofstream fout( m_szFileName ,std::ios_base::binary );
fout.unsetf(std::ios_base::skipws);
bencode(std::ostream_iterator<char>(fout), t.generate() );
2) Is it possible to select files from different directories, and make multifile
torrent?
3) Is it possible to skip hash checking when adding a torrent, and
set paths to files that will be seeding?
(Continue reading)
RSS Feed