rndusr / torf-cli

CLI tool for creating, reading and editing torrent files
GNU General Public License v3.0
134 stars 13 forks source link

Add support for multiple filename inputs #15

Closed bbepis closed 4 years ago

bbepis commented 4 years ago

Right now it's only possible to add multiple files to a torrent by specifying a directory, but this includes the top level directory in the torrent as the root.

For example, running torf /my/files creates this:

files/file1.txt
files/directory/file2.txt

when for my use case, I want this instead:

file1.txt
directory/file2.txt

Is it possible to allow for torf-cli to have multiple file arguments specified? Such that this would work:

torf /my/files/* ...

This would solve my issue as above.

Alternatively, a switch for excluding the top level directory and having the contents as the root(s) would be acceptable.

rndusr commented 4 years ago

This is not possible because of how files are stored in the .torrent file.

A multi-file torrent has a list of relative file paths and a name. When a client downloads the torrent's content, it interprets the name as the top-level directory and stores all files in it.