pobrn / mktorrent

A simple command line utility to create BitTorrent metainfo files
Other
474 stars 72 forks source link

mktorrent doesn't allow one to overwrite an existing file #35

Closed paride closed 4 years ago

paride commented 4 years ago

Forwarded from: https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=mktorrent

Probably the best way to create a temporary file in Shell is to use mktemp(1). Alas, mktorrent(1) doesn't allow for the --output= file to be overwritten, thus making it “incompatible” with mktemp(1). Consider, e.g.:

$ mktorrent --announce=http://nowhere.invalid:8080/ \
      -o "$(mktemp -t -- torrent.XXXXXXXX)" -- example 
mktorrent 1.0 (c) 2007, 2009 Emil Renner Berthing

Error creating '/tmp/torrent.xejf3RRS': File exists

AIUI, the conventional wisdom is to support some kind of a --force option to disable the checks such as the one performed by mktorrent(1) in open_file().