Open files to export as O_WRONLY instead of O_RDWR

This commit is contained in:
Seednode 2023-06-13 08:50:13 -05:00
parent 9a23387a6b
commit 911708b95c
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import (
)
const (
Version string = "0.51.4"
Version string = "0.51.5"
)
var (

View File

@ -118,7 +118,7 @@ func (i *Index) IsEmpty() bool {
}
func (i *Index) Export(path string) error {
file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
return err
}
@ -338,7 +338,7 @@ func (s *ServeStats) GetMostServed() string {
}
func (s *ServeStats) Export(path string) error {
file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
return err
}