![]() And using Extract(destinaltion_path string), I can also extract it to a local directory. I am able to get the list of the files in the archive. file, err := os.OpenFile(Ī, err := extractor.NewArchiveFromReader(file) But this is returning an error saying Bad File Descriptor. ![]() There's another method NewArchiveFromReader(r io.Reader). So I will either have to find a different method or convert the os.file to byte. But I can't read from local and will have to use a file from memory of type os.file. It reads files from local using ioutil and the input of NewArchiveFromMemory must be of type byte. This prints a list of all the files in the archive. To do this, I found a package /gen2brain/go-unarr (imported as extractor) and this is what I have so far content, err := ioutil.ReadFile("sample_archive.7z")Ī, err := extractor.NewArchiveFromMemory(content) I am trying to list all the files in the archive and upload them to an s3 bucket.
0 Comments
Leave a Reply. |