viant / afs

Abstract File Storage
Apache License 2.0
302 stars 37 forks source link

unzip dir.zip #20

Closed Alex-query closed 1 year ago

Alex-query commented 1 year ago

i use this code to zip and unzip folder

service := afs.New() ctx := context.Background() uploader := zip.NewBatchUploader(file.New()) err := service.Copy(ctx, "deployments", "zipped.zip", uploader) if err != nil { log.Fatal(err) }

walker := zip.NewWalker(file.New()) err = service.Copy(ctx, "zipped.zip", "zipped", walker) if err != nil { log.Fatal(err) }

zip - works properly , but uzip doesn`t

i zipped folder with one file "deployments\docker-compose\docker-compose.yml" As result after unzip , i get "zipped\docker-compose\zipped.zip" . An intresting thing is that "zipped\docker-compose\zipped.zip" is a txt file with rigth conent . But name of folder is wrong

adranwit commented 1 year ago

Could you please provide an archive that unzip does not work correctly, thanks in advance

Alex-query commented 1 year ago

zipped.zip

adranwit commented 1 year ago

The issue has been addressed in https://github.com/viant/afs/releases/tag/v1.23.1

adranwit commented 1 year ago

Thank for contributing

Alex-query commented 1 year ago

@adranwit i decided to try again, but i have a problem with this zip file " mkdir ........zipped/: Cannot create a file when that file already exists" i use v1.24.2