mirror of
https://github.com/RoganDawes/P4wnP1_aloa.git
synced 2025-03-18 05:41:55 +01:00
webclient HIDScript: truncate files on overwrite
This commit is contained in:
parent
ee594aaf52
commit
452ca52689
@ -5,7 +5,7 @@ import "os"
|
||||
func WriteFile(path string, mustNotExist bool, append bool, data []byte) (error) {
|
||||
flag := os.O_CREATE | os.O_WRONLY
|
||||
if mustNotExist { flag |= os.O_EXCL }
|
||||
if append { flag |= os.O_APPEND }
|
||||
if append { flag |= os.O_APPEND } else { flag |= os.O_TRUNC }
|
||||
f, err := os.OpenFile(path, flag, os.ModePerm)
|
||||
f.Stat()
|
||||
if err != nil { return err }
|
||||
|
Loading…
x
Reference in New Issue
Block a user