MCPcopy Create free account
hub / github.com/adeljck/PassGet / OutPutToFile

Function OutPutToFile

modules/utils/utils.go:55–76  ·  view source on GitHub ↗
(content string, dir string)

Source from the content-addressed store, hash-verified

53 return err == nil
54}
55func OutPutToFile(content string, dir string) error {
56 _, err := os.Stat(dir)
57 if os.IsNotExist(err) {
58 // 目录不存在,创建目录
59 err = os.MkdirAll(dir, 0755)
60 if err != nil {
61 return err
62 }
63 }
64 file, err := os.OpenFile(fmt.Sprintf("%s/results.txt", dir), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
65 if err != nil {
66 return err
67 }
68 defer file.Close()
69
70 // 写入内容
71 _, err = file.WriteString(content)
72 if err != nil {
73 return err
74 }
75 return nil
76}

Callers 7

GetTodeskFunction · 0.92
GetSunloginFunction · 0.92
GetFinalShellFunction · 0.92
GetNaviCatFunction · 0.92
GetFileZillaFunction · 0.92
GetWiFiFunction · 0.92
GetWinSCPFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected