import (
"bufio"
+ "bytes"
"encoding/hex"
"fmt"
"log"
return lines
}
+func saveTorrent(t *torrent.Torrent) error {
+ pth := t.Name() + TorrentExt
+ if _, err := os.Stat(pth); err == nil {
+ return nil
+ }
+ var b bytes.Buffer
+ t.Metainfo().Write(&b)
+ return os.WriteFile(pth, b.Bytes(), 0666)
+}
+
func fifoAdd(c *torrent.Client) {
pth := path.Join(FIFOsDir, "add")
recreateFIFO(pth)