Net::BitTorrent::Torrent::File - BitTorrent File I/O Class


Net-BitTorrent documentation  | view source Contained in the Net-BitTorrent distribution.

Index


NAME

Top

Net::BitTorrent::Torrent::File - BitTorrent File I/O Class

Constructor

Top

new ( { [ARGS] } )

Creates a Net::BitTorrent::Torrent::File object. This constructor should not be used directly.

Methods

Top

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 default 2 and and be positive we'll work on it first. To avoid downloading this file, set priority to 0.

See also: priority ( )

NOTE: Setting the priority to 0 will tell Net::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

Top

Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/

CPAN ID: SANKO

License and Legal

Top


Net-BitTorrent documentation  | view source Contained in the Net-BitTorrent distribution.