Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: popen equivalent in C++



Well, I don't know about the "modern" way of doing this that you asked for...

>    FILE *file = popen("gunzip -c " + name, "r"); // 'name' is a string
>    ifstream *stream = new ifstream(fileno(file));

But the old-fashioned way I did this was just to use the functions from zlib -
it was a while ago but it used to (presumably still does?) provide functions
for reading/writing compressed I/O. 
As C, obviously, but they worked well from within my C++ code...

Might work.
-- 
Ian
_______________________________________________
unix-porting mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/unix-porting
Do not post admin requests to the list. They will be ignored.





Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.