From b7b9d2b8a21bd072fc38a0ed1768be4f6fecb21f Mon Sep 17 00:00:00 2001 From: pearceduan Date: Thu, 21 May 2020 13:02:08 +0800 Subject: [PATCH] bugfix for directory permission --- .gitignore | 3 ++- flv.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 55371e5..20335c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -.vscode \ No newline at end of file +.vscode +.idea \ No newline at end of file diff --git a/flv.go b/flv.go index 62fa931..97e30e9 100644 --- a/flv.go +++ b/flv.go @@ -35,8 +35,8 @@ func SaveFlv(streamPath string, append bool) error { flag = flag | os.O_TRUNC | os.O_WRONLY } filePath := filepath.Join(config.Path, streamPath+".flv") - os.MkdirAll(path.Dir(filePath), 0666) - file, err := os.OpenFile(filePath, flag, 0666) + os.MkdirAll(path.Dir(filePath), 0775) + file, err := os.OpenFile(filePath, flag, 0775) if err != nil { return err }