Generate a .torrent binary string from files in the filesystem
// 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; }
// 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 : Torrent