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

Function IsNotExistCreateFile

pkg/utils/file/file.go:183–191  ·  view source on GitHub ↗

IsNotExistCreateFile create a file if it does not exist

(src string)

Source from the content-addressed store, hash-verified

181
182// IsNotExistCreateFile create a file if it does not exist
183func IsNotExistCreateFile(src string) error {
184 if notExist := CheckNotExist(src); notExist {
185 if err := CreateFile(src); err != nil {
186 return err
187 }
188 }
189
190 return nil
191}
192
193func ReadFullFile(path string) []byte {
194 file, err := os.Open(path)

Callers 2

WriteToFullPathFunction · 0.85
SpliceFilesFunction · 0.85

Calls 2

CheckNotExistFunction · 0.85
CreateFileFunction · 0.85

Tested by

no test coverage detected