Method Protocols.Bittorrent.Torrent()->fix_targets()
- Method
fix_targets
intfix_targets(void|int(-1..2)allocate,void|stringbase_filename,void|function(int,int:void)progress_callback)- Description
Opens target datafile(s).
If all files are created, the verify info will be filled as well, but if it isn't created, a call to
verify_target()is necessary after this call.- Parameter
allocate Determines allocation procedure if the file doesn't exist:
0Don't allocate.
1Allocate virtual file size (seek, write end byte).
2Allocate for real (will call progress_callback(pos,length)).
-1Means never create a file, only open old files.
- Parameter
my_filename A new base filename to substitute the metainfo base target filename with.
- Returns
1The (a) file was already there.
2All target files were created.