MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / createFile

Function createFile

core/cmd/server/cmd/app.go:106–117  ·  view source on GitHub ↗
(filePath string)

Source from the content-addressed store, hash-verified

104}
105
106func createFile(filePath string) error {
107 if _, err := os.Stat(filePath); err == nil {
108 return nil
109 }
110 file, err := os.Create(filePath)
111 if err != nil {
112 fmt.Println(i18n.GetMsgWithMapForCmd("AppCreateFileErr", map[string]interface{}{"name": filePath, "err": err.Error()}))
113 return err
114 }
115 defer file.Close()
116 return nil
117}
118
119func createFolder(dirPath string) error {
120 if _, err := os.Stat(dirPath); err == nil {

Callers 1

app.goFile · 0.70

Calls 4

CreateMethod · 0.65
CloseMethod · 0.65
StatMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected