MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / CreateNestedFile

Method CreateNestedFile

drivers/smb/util.go:133–142  ·  view source on GitHub ↗

CreateNestedFile create nested file

(path string)

Source from the content-addressed store, hash-verified

131
132// CreateNestedFile create nested file
133func (d *SMB) CreateNestedFile(path string) (*smb2.File, error) {
134 basePath := filepath.Dir(path)
135 if !d.Exists(basePath) {
136 err := d.fs.MkdirAll(basePath, 0700)
137 if err != nil {
138 return nil, err
139 }
140 }
141 return d.fs.Create(path)
142}

Callers 1

CopyFileMethod · 0.95

Calls 3

ExistsMethod · 0.95
CreateMethod · 0.65
MkdirAllMethod · 0.45

Tested by

no test coverage detected