Skip to content

Commit

Permalink
fix: bad file descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
Clov614 committed Aug 12, 2024
1 parent 90da50b commit 72ac228
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rikkabot/manager/imgManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (fic *tFileImgCache) findImgData(imgId string, imgDate string) (data []byte

// 保存图片为文件
func (fic *tFileImgCache) saveImgByData(path string, imgData []byte) (err error) {
file, err := os.OpenFile(path, os.O_CREATE, os.ModePerm)
file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.ModePerm)
if err != nil {
return fmt.Errorf("save img as file err: %w", err)
}
Expand Down

0 comments on commit 72ac228

Please sign in to comment.