| Extracted from Pike v7.8 release 866 at 2018-02-09.

[Top]
Protocols
Protocols.Bittorrent
Protocols.Bittorrent.Generator

# Class Protocols.Bittorrent.Generator

Description

  Generate a .torrent binary string from files in the filesystem

Example

      // usage: thisprogram [<file/dir>] [<file/dir>...] <target .torrent>
         int main(int ac,array am)
         {
            Generator g=Generator();
            foreach (am[1..<1];;string f)
               g->add(f);
            string dest=am[-1];
            if (-1==search(dest,"torrent")) dest+=".torrent";
            Stdio.write_file(dest,g->digest());
            return 0;
         }

Inherit Torrent

  inherit .Torrent : Torrent