FileEntry

class FileEntry(val path: String, val size: Long, val offset: Long, val piecesRoot: Sha256Hash? = null, val isPadFile: Boolean = false, val symlinkTarget: String? = null, val isExecutable: Boolean = false, val isHidden: Boolean = false)

One file within a torrent: port of the per-file data libtorrent keeps in file_storage (file_storage.hpp). offset is the file's start within the torrent's single concatenated byte stream, which is what maps pieces to files.

Constructors

Link copied to clipboard
constructor(path: String, size: Long, offset: Long, piecesRoot: Sha256Hash? = null, isPadFile: Boolean = false, symlinkTarget: String? = null, isExecutable: Boolean = false, isHidden: Boolean = false)

Properties

Link copied to clipboard

True if BEP-47 marks the file executable (attr contains 'x').

Link copied to clipboard

True if BEP-47 marks the file hidden (attr contains 'h').

Link copied to clipboard

True if this is a BEP-47 padding file (attr contains 'p').

Link copied to clipboard

Just the file name, without directories.

Link copied to clipboard

Byte offset of this file within the concatenated torrent data.

Link copied to clipboard

Full path, '/'-separated, including the torrent's root directory for multi-file torrents.

Link copied to clipboard

v2 per-file merkle root ("pieces root"), or null for v1 torrents.

Link copied to clipboard
val size: Long

Size of the file in bytes.

Link copied to clipboard

Symlink target path if this entry is a symlink (attr contains 'l'), else null.

Functions

Link copied to clipboard
open override fun toString(): String