Create pipe in tmp directory instead of cwd

This commit is contained in:
Gabe Kangas
2020-06-01 17:42:36 -07:00
parent 161aaeec8d
commit d0ec846b30
4 changed files with 12 additions and 6 deletions

View File

@@ -6,7 +6,6 @@ import (
"io"
"log"
"os"
"path/filepath"
"syscall"
"github.com/pkg/errors"
@@ -52,10 +51,9 @@ func (h *Handler) OnPublish(timestamp uint32, cmd *rtmpmsg.NetStreamPublish) err
return errors.New("PublishingName is empty")
}
// Record streams as FLV!
p := filepath.Join(
filepath.Clean(filepath.Join("./", fmt.Sprintf("%s.flv", "streampipe"))),
)
// Record streams as FLV
p := getTempPipePath()
fmt.Println(p)
syscall.Mkfifo(p, 0666)
f, err := os.OpenFile(p, os.O_RDWR, os.ModeNamedPipe)
if err != nil {