MCPcopy Index your code
hub / github.com/SummerSec/SpringExploit / writeBytesToFile

Function writeBytesToFile

cmd/commons/utils/saveresult.go:41–51  ·  view source on GitHub ↗

写入文件

(filepath string, content []byte)

Source from the content-addressed store, hash-verified

39
40//写入文件
41func writeBytesToFile(filepath string, content []byte) {
42 //打开文件,没有此文件则创建文件,将写入的内容append进去
43 w1, error := os.OpenFile(filepath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
44 checkError(error)
45
46 _, err1 := w1.Write(content)
47 checkError(err1)
48
49 errC := w1.Close()
50 checkError(errC)
51}
52
53func checkError(err error) {
54 if err != nil {

Callers

nothing calls this directly

Calls 1

checkErrorFunction · 0.85

Tested by

no test coverage detected