alexpdev / torrentfile

Bittorrent Protocol v1 & v2 metafile creator, checker, editor, builder, reviewer. Assemble .torrent files from the command line.
Apache License 2.0
43 stars 4 forks source link

test if output directory is writeable #164

Closed alexpdev closed 1 year ago

alexpdev commented 1 year ago

In it's current and previous versions, the process used to create .torrent files gathers the relative information, calculates the hashes, and writes the information to the disk. This has the unfortunate consequence of only raising permission errors after the most time consuming portion of the process has already taken place.

A test should be implemented prior to calculating the hashes to ensure the output path is writeable so that it can warn the user who can then request the proper permissions, or choose an alternative output directory.