Skip to content

Torrents and Files

parg edited this page Apr 16, 2024 · 11 revisions

Searching for Existing Files

This feature is useful if you have a download in your Library but one or more of its files are not currently in the correct place. Reasons for this could be that you have manually reorganised files outside of BiglyBT (i.e. not using the "Move Data Files" feature, which is generally the preferred approach) or perhaps you have added a new download and know that you already have some of its files downloaded and want to use them rather than re-download them.

Most modes of operation require files to be matched based on file size and content (names often clash/differ across downloads). When matching on content it is important to understand the way that bittorrent manages file verification by "pieces" - see elsewhere in this page for details. For a file to be matched based on content it has to contain at least one piece of data, if it is smaller than this then it can only be matched based on size. Matching proceeds by attempting to match files based on content. If one or more files succeed then matching of the files containing less than one piece is done by checking their location relative to the matched file(s) and their size.

The feature is accessed by right-clicking on one or more downloads in your Library and selecting the Content tab from the smart menu (or Advanced->Files from the legacy torrent menu)

You are then presented with a dialog to configure your search options and behaviour.

  • Default search locations
    If you are using this feature often, or want to add multiple search locations, set up default locations by hitting the 'add' button to the right of the explicit location when entered. Entries can be deleted by right-clicking on them and selecting 'remove'.
  • Explicit search location
    Enter a single search location here and optionally add it to the default locations via the 'add' button.
  • Mode
    * Link
      Linking results in files with the download being individually pointed at matching files located at other positions in your file system(s). There are two linking modes available in general. "Internal Linking" is when BiglyBT internally points the file to a new location - the file systems themselves are not aware of this. "Hard Linking" is a file-system supported means of linking one file to another. Generally cross-file-system hard links are not supported, refer to file system documentation for the details and implications of this.
    * Copy
      When a file is matched, rather than pointing the download to the location of the matching file the file is instead copied into the required location. This results in the fixed up download not depending on external files but results in space being wasted due to duplication.
    * Move
      Like Copy but the file is Moved instead. This results in no space being wasted but of course the file is no longer in the original location so you must ensure this doesn't break something else.
    * Piece
      This mode is somewhat different in that it will deal with partially matching files (e.g. the original has only been partially downloaded for some reason). During the matching process any pieces that verify successfully are copied from the originating file into the download's file. This mode will generally leave the beginning+end of files unmatched even if the file being copied from is identical to the download's file, so only use it when other forms of matching fail.
    * Relocate
      This mode is of use when the entire download is known to have been moved elsewhere and you simply want BiglyBT to update its internal reference. The file names and sizes have to match exactly with the expected ones.
  • Tolerance
    Generally this should not be changed, the feature was added to allow matching in the rare case that the target file size is slightly larger or smaller than expected due to metadata being added.
  • Skipped files
    Normally skipped files (i.e. those marked as not being required to be downloaded) are ignored during the matching process. Enabling this option allows those files to automatically be set to non-skipped if a matching file happens to be found.
  • Test (Since 3501)
    If this box is checked then the operation is carried out as usual but no changes are made. Instead the logging shows what changes would be made.

Common Questions

Why are files being created/allocated on disk when they are deselected?

A multi-file torrent lists the files contains within it in order (commonly alphabetically but it doesn't have to be).

Let's call these files A, B, C and D.

The BitTorrent protocol deals with things called 'pieces' of a fixed size (apart from the last piece which may be smaller) - this size is selected by the torrent creator but is a power of 2 - for example 16KB, 256KB, 4MB.

The files (A,B,C,D in this example) are logically laid out in order and the pieces allocated sequentially. If we have a piece size of 16KB then the first 16KB of file A will be piece 1, the next 16KB piece 2 etc until the end of file A is reached. At this point whatever bytes are needed from file B to complete the piece are used. Say file A was 41KB in size. The first 2 pieces would use the first 32KB of A. This would leave 9KB remaining so piece 3 would be made up from the last 9KB from file A and the first 7KB from file B (assuming B was at least 7KB in size - if it was less then all of B would be used and some of C...)

So you can see that pieces at the start and end of a file will in general be made up from parts of multiple files.

In order to download a file the BitTorrent protocol demands that all of the pieces that it contains be downloaded and stored on disk (they must be stored as in order to seed data to other peers entire pieces are needed, it is not possible to seed a partial piece).

So in the example above in order to download file A it is necessary to also download the first 7KB of file B.

Even if you have deselected file B and have no interest in it whatsoever it will be necessary to download the start of file B.

This is why you will see deselected files being created when downloading.

You might say 'why can't BiglyBT store these files somewhere else hidden away to stop burning my eyes with unwanted files?' Well, it could, but it doesn't. The main reason is that if you wanted to reseed the torrent at a later time you would need the partial file contents to be able to do so. If they were hidden away you wouldn't be able to do this.

You can however configure BiglyBT to rename such files with an extension, or put them into a subdirectory. See Options->Files.

"Do not download" -vs- "Delete" file priority

A file can have various "priority" settings, amongst these are "do not download" and "delete". The reason there are two settings with similar connotations is to allow differentiation between a file you will never want to download ("delete") and one that you currently don't want to download but may want to in the future, or perhaps decide to suspend download halfway through ("do not download").

A "delete" file will not appear on disk (unless required due to the discussion above) whereas a "do not download" file will appear but take up space as required. So if you switch a 50% downloaded file to "do not download" then it will remain at 50% until you decide to continue downloading it. If you switch a 50% downloaded file to "delete" then its contents will be deleted (subject to the discussion above again)