Thread Subject: unzip/gunzip into memory

Subject: unzip/gunzip into memory

From: E

Date: 28 Nov, 2008 09:31:03

Message: 1 of 4

Hi,

I would like to unzip/gunzip a file into memory instead of writing it to a file first and then
having to read it in again. Is this possible ?
I had a look at the gunzip command and it involves java, can I get to the unzipped data before it is written to file ?

Thanks !

Subject: unzip/gunzip into memory

From: Yuri Geshelin

Date: 28 Nov, 2008 13:30:19

Message: 2 of 4

"E " <ehelden@hotmail.com> wrote in message <ggodom$65o$1@fred.mathworks.com>...
> Hi,
>
> I would like to unzip/gunzip a file into memory instead of writing it to a file first and then
> having to read it in again. Is this possible ?
> I had a look at the gunzip command and it involves java, can I get to the unzipped data before it is written to file ?
>
> Thanks !

Hi

I don't think it is possible. What prevents you from reading the file from disk immediately after gunzipping it? Surely not the lack of disk space. If the time constraints are issue, try virtual drive. This is not matlab topic.

Subject: unzip/gunzip into memory

From: Walter Roberson

Date: 28 Nov, 2008 15:29:32

Message: 3 of 4

E wrote:

> I would like to unzip/gunzip a file into memory instead of writing it to a file first and then
> having to read it in again. Is this possible ?

Yes, you could write a mex interface to zlib.

Alternately, you could mmap the output file. It will still be written to disk, but it
would also be available in memory.

--
.signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?

Subject: unzip/gunzip into memory

From: Ljubomir Josifovski

Date: 6 Jan, 2009 11:56:25

Message: 4 of 4

On 28 Nov 2008, 15:29, Walter Roberson <rober...@hushmail.com> wrote:
> E wrote:
> > I would like to unzip/gunzip a file into memory instead of writing it to a file first and then
> > having to read it in again. Is this possible ?
>
> Yes, you could write a mex interface tozlib.

Somewhat related - does anyone know of a Matlab native implementation
of zlib?
(say analogous to csharp native implementation
http://www.icsharpcode.net/OpenSource/SharpZipLib/ etc)

I expect unlikely but thought I'd better ask.

Thanks in advance,
Ljubomir

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
unzip E 28 Nov, 2008 04:35:04
gunzip E 28 Nov, 2008 04:35:04
java E 28 Nov, 2008 04:35:04
memory E 28 Nov, 2008 04:35:04
rssFeed for this Thread

Contact us at files@mathworks.com