NAME
Net::BitTorrent::Torrent::File - BitTorrent File I/O Class
Constructor
new ( { [ARGS] } )
-
Creates a
Net::BitTorrent::Torrent::File
object. This constructor should not be used directly.
Methods
index ( )
-
Returns the zero based index of this file according to the related Net::BitTorrent::Torrent object's file list.
mode ( )
-
Returns a value representing if and how the related file handle is open. Possible values:
'ro' - Read only 'wo' - Write only 'rw' - Read and Write undef - Closed
path ( )
-
Returns the absolute path of the related file.
priority ( )
-
Returns the download priority of this file.
See also: set_priority ( )
set_priority ( NEWVAL )
-
Sets the download priority of this file.
By default, all files begin with a level two (2) priority with the intent being on a
0
(skip),1
(low),2
(normal),3
(high) priority scale but you may use any scale you want. For example, you could set a file's priority to say...1,000,000
, leave everything else at the default2
and and be positive we'll work on it first. To avoid downloading this file, set priority to0
.See also: priority ( )
NOTE: Setting the priority to
0
will tellNet::BitTorrrent
not to bother requesting these pieces however, the file will still be created on disk if a piece we want overlaps onto this file. Just give me some time to work on an intermediate .piece file and this problem will go away. torrent ( )
-
Returns the Net::BitTorrent::Torrent object related to this file.
size ( )
-
Returns the size of the file represented by this object.
as_string ( [ VERBOSE ] )
-
Returns a 'ready to print' dump of the object's data structure. If called in void context, the structure is printed to
STDERR
.VERBOSE
is a boolean value.
Author
Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
CPAN ID: SANKO
License and Legal
Copyright (C) 2008-2009 by Sanko Robinson <sanko@cpan.org>
This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or http://www.perlfoundation.org/artistic_license_2_0. For clarification, see http://www.perlfoundation.org/artistic_2_0_notes.
When separated from the distribution, all POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See http://creativecommons.org/licenses/by-sa/3.0/us/legalcode. For clarification, see http://creativecommons.org/licenses/by-sa/3.0/us/.
Neither this module nor the Author is affiliated with BitTorrent, Inc.