How can I read from .tar.zip without unzipping it?

조회 수: 8 (최근 30일)
Sam Da
Sam Da 2011년 2월 14일
I have about 16gb of stock data which if unzipped is more than 200gb (hd of my pc). Is there way to read the files inside this folder without unzipping and untarring it. The zipped files are *.mat

채택된 답변

Walter Roberson
Walter Roberson 2011년 2월 14일
It would be possible if it was a zip archive containing multiple files, instead of a zip archive containing one file that was a tar file that contains multiple files. A zip archive contains information about how much space the compressed file takes, allowing you to skip directly to the beginning of the header for the next compressed file. The tar archive, however, has no knowledge that it has been compressed, so it only gives you information about the uncompressed space the file occupies, requiring you to expand everything after that point to get to the header for the next archive member.
It would be programmatically possible to do a pass of building a three-part index into the zip file, with the first part telling you where you had to seek inside the zip to reach the closest synchronization point before beginning of the individual file tar header, and the second part telling you how many uncompressed characters to skip to get to the tar header, and the third part telling you how many compressed bytes to reach the end of the tar element. That could be done without writing anything other than the index to disk. But it would be a bit of a nuisance to write. If you have enough temporary space, I would suggest unzipping and untaring and then creating a zip archive without the tar level.
  댓글 수: 1
Todd Flanagan
Todd Flanagan 2011년 2월 14일
Sam says, "Okay, I will try to create the zip instead. So, my zip will contain 1.mat, 2.mat ,etc. How do I read these .mat files from the zip without unzipping?"

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 File Compression에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by