(ctx context.Context, storage driver.Driver, path string, args model.ArchiveInnerArgs)
| 471 | } |
| 472 | |
| 473 | func 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 | |
| 493 | func 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 { |
no test coverage detected