当我尝试从包含多个空子目录的目录中创建一个 torrent 文件时,这些目录在 torrent 文件中被忽略并省略。我想知道这是 qBittorrent 的事情还是BitTorrent 协议的指定限制。BitTorrent 协议是否允许您共享空目录,保留实际的文件树?
编辑⸺那里有空目录的种子。
是的,实际上有几个。但是怎么做?
当我尝试从包含多个空子目录的目录中创建一个 torrent 文件时,这些目录在 torrent 文件中被忽略并省略。我想知道这是 qBittorrent 的事情还是BitTorrent 协议的指定限制。BitTorrent 协议是否允许您共享空目录,保留实际的文件树?
是的,实际上有几个。但是怎么做?
在 BitTorrent 协议中共享空目录是不可能的。
All files in a BitTorrent metafile (.torrent file) are listed in the "files" list which is located inside the "info" dictionary. Directories are stored as part of the "path" to a a file relative to the root directory.
The BitTorrent v1 protocol specification states:
See: https://www.bittorrent.org/beps/bep_0003.html
This means that it is impossible to share directories without any files in them as the last element of a path will always be interpreted as a filename.
Following example shows how the paths to files are stored inside a .torrent file (formatted as JSON):
This torrent contains two files:
目录“stage_2_test_images_jpg”之所以存在,是因为它包含在文件“0000a175-0e68-4ca4-b1af-167204a7e0bc.jpg”的“路径”中。
如果我们从 torrent 中删除“0000a175-0e68-4ca4-b1af-167204a7e0bc.jpg”,目录“stage_2_test_images_jpg”将成为“路径”中的最后一个元素,并将成为文件而不是目录。