Hello Folks,
I have to open a file that can either be zipped or unzipped, but is a text file neverthless.
I can use gzgets(from zlib.h) for the zipped version, or simply use fgets (cstdio.h) . Now which one do u suggest would be a faster mode of opening and reading the file. All the functions that are there for unzipped files, are there for zipped also . (Link - http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/libzman.html )
That depends. Do you want to get the contents of the zip file; then figure out if it's zipped or unzipped; and convert it to text or just read it if it turns out to be unzipped? Or do you need to unzip the file and then read it?
I think reading the zip file yourself will be much more fun; but it may well be harder...