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

Function InternalExtract

internal/op/archive.go:473–491  ·  view source on GitHub ↗
(ctx context.Context, storage driver.Driver, path string, args model.ArchiveInnerArgs)

Source from the content-addressed store, hash-verified

471}
472
473func InternalExtract(ctx context.Context, storage driver.Driver, path string, args model.ArchiveInnerArgs) (io.ReadCloser, int64, error) {
474 _, t, ss, err := GetArchiveToolAndStream(ctx, storage, path, args.LinkArgs)
475 if err != nil {
476 return nil, 0, err
477 }
478 rc, size, err := t.Extract(ss, args)
479 if err != nil {
480 var e error
481 for _, s := range ss {
482 e = stderrors.Join(e, s.Close())
483 }
484 if e != nil {
485 log.Errorf("failed to close file streamer, %v", e)
486 err = stderrors.Join(err, e)
487 }
488 return nil, 0, err
489 }
490 return &streamWithParent{rc: rc, parents: ss}, size, nil
491}
492
493func ArchiveDecompress(ctx context.Context, storage driver.Driver, srcPath, dstDirPath string, args model.ArchiveDecompressArgs, lazyCache ...bool) error {
494 if storage.Config().CheckStatus && storage.GetStorage().Status != WORK {

Callers 2

archiveInternalExtractFunction · 0.92
SharingArchiveExtractFunction · 0.92

Calls 3

GetArchiveToolAndStreamFunction · 0.85
ExtractMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected