gzip keeps original file
조회 수: 5 (최근 30일)
이전 댓글 표시
I just noticed the default behavior of the Matlab gzip command is to keep the original uncompressed file. Is there a way to have it behave more like the unix gzip(1) command, that is, remove the original file after commpressing?
댓글 수: 0
답변 (5개)
Tom
2011년 4월 7일
댓글 수: 3
Jan
2011년 4월 8일
@Tom: If you are in fear, that the original files are deleted by accident, use RECYCLE to enable the usage of the recycle bin for DELETE.
Walter Roberson
2011년 4월 8일
One of the things I would want to check on is whether you can be guaranteed that by the time the write stream close returns, that the file has been completely dispatched to the operating system to write and that there was enough disk space to write. Better, that the write did succeed (e.g., no bad blocks.) Even then if your files happened to be over NFS I would want stricter conditions, as I have observed in the past that the local system believed (with good reason) that the file had been completely written, but that there were errors on the server side.
Andres
2011년 6월 29일
Hello guys, did someone find a solution for the check? I am currently searching for a way to test the integrity of zipped files via Matlab-GZIP.
댓글 수: 0
Daniel Shub
2011년 6월 29일
If you like the unix gzip, why not just use it directly ...
system(['gzip ', FileNameStr])
댓글 수: 0
Tom K
2011년 6월 30일
Thanks for everyone's comments. My original question came up in the context of a program I'm writing that does a file gunzip, reads the file, then gzip's file again. I use the fact that Matlab's gunzip also keeps the original compressed file, and write the uncompressed file to a temp dir and read it into Matlab from there. My original file, gzipped in unix, remains as it was, so no need for checking, and no extra clutter in the original dir. Good enough for me.
Sounds like if you want a gzip with consistency checks, the unix gzip is the way to go.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 File Compression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!