PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Memory file-descriptor

Dave Johnston · 24 Aug 2003, 10:14 UTC
Time for a classic usenet question...

My aim: to use my existing f-based method (fopen, fread, fgets, fclose) to read data from a Resource as if it were a file.

Ideally: I'd get a file descriptor/handle that I could pass to fdopen/gzdopen. That way I could read from compressed files and Resources and save a bit of space.

Any ideas or suggestions? I could just create a new method that performs the same loading procedure but from the uncompressed data (using LoadResource to get into memory, etc.) - but ideally I'd like everything to be compressed.

Chances are I will end up having two methods (one for compressed data in a file, one for uncompressed data in a Resource) - but hey, it's worth a try :)