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

Method CreateFile

service/system.go:226–237  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

224}
225
226func (c *systemService) CreateFile(path string) (int, error) {
227 _, err := os.Stat(path)
228 if err == nil {
229 return common_err.FILE_OR_DIR_EXISTS, nil
230 } else {
231 if os.IsNotExist(err) {
232 file.CreateFile(path)
233 return common_err.SUCCESS, nil
234 }
235 }
236 return common_err.SERVICE_ERROR, err
237}
238
239func (c *systemService) GetDeviceTree() string {
240 if output, err := command.OnlyExec("source " + config.AppInfo.ShellPath + "/helper.sh ;GetDeviceTree"); err != nil {

Callers

nothing calls this directly

Calls 1

CreateFileMethod · 0.65

Tested by

no test coverage detected