MCPcopy Index your code
hub / github.com/kopia/kopia / OpenFile

Method OpenFile

internal/webdavmount/webdavmount.go:187–207  ·  view source on GitHub ↗
(ctx context.Context, path string, _ int, _ os.FileMode)

Source from the content-addressed store, hash-verified

185}
186
187func (w *webdavFS) OpenFile(ctx context.Context, path string, _ int, _ os.FileMode) (webdav.File, error) {
188 f, err := w.findEntry(ctx, path)
189 if err != nil {
190 log(ctx).Errorf("OpenFile(%q) failed with %v", path, err)
191 return nil, err
192 }
193
194 switch f := f.(type) {
195 case fs.Directory:
196 iter, err := f.Iterate(ctx)
197 if err != nil {
198 return nil, err //nolint:wrapcheck
199 }
200
201 return &webdavDir{ctx, w, webdavFileInfo{f}, iter}, nil
202 case fs.File:
203 return &webdavFile{ctx: ctx, entry: f}, nil
204 }
205
206 return nil, errors.Errorf("can't open %q: not implemented", path)
207}
208
209func (w *webdavFS) Stat(ctx context.Context, path string) (os.FileInfo, error) {
210 e, err := w.findEntry(ctx, path)

Callers 6

getOutputFunction · 0.45
WritePrivateKeyToFileFunction · 0.45
WriteCertificateToFileFunction · 0.45
CreateNewFileMethod · 0.45
createTempFileAndDirMethod · 0.45
writeFunction · 0.45

Calls 3

findEntryMethod · 0.95
ErrorfMethod · 0.80
IterateMethod · 0.65

Tested by

no test coverage detected