MCPcopy Create free account
hub / github.com/CRED-CLUB/propeller / CreateFile

Method CreateFile

pkg/fs/fs.go:124–131  ·  view source on GitHub ↗

CreateFile ...

(filePath string, forceCreate bool)

Source from the content-addressed store, hash-verified

122
123// CreateFile ...
124func (l *LocalFileSystem) CreateFile(filePath string, forceCreate bool) error {
125 _, err := os.Stat(filePath)
126 if !forceCreate && os.IsExist(err) {
127 return fmt.Errorf("error in stating file %s because of %v", filePath, err)
128 }
129 _, err = os.Create(filePath)
130 return err
131}
132
133// WriteFile ...
134func (l *LocalFileSystem) WriteFile(filePath string, permission os.FileMode, contents []byte) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected