MCPcopy
hub / github.com/IceWhaleTech/CasaOS / CreateFile

Function CreateFile

pkg/utils/file/file.go:158–165  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

156}
157
158func CreateFile(path string) error {
159 file, err := os.Create(path)
160 if err != nil {
161 return err
162 }
163 defer file.Close()
164 return nil
165}
166
167func CreateFileAndWriteContent(path string, content string) error {
168 file, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, 0o666)

Callers 1

IsNotExistCreateFileFunction · 0.85

Calls 2

CloseMethod · 0.80
CreateMethod · 0.65

Tested by

no test coverage detected