I am trying to read a gzip file line by line (once decoded) to preserve memory limit, is this possible?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, it doesn’t read the file into memory. If you look at the documentation you will see that it returns a resource to the archived file. You can then use other function to read a certain amount of data (until the first line delimiter, or a fixed number of bytes, or even the whole file). If you look at the available functions you will see that they are very similar to those from the file API.
Bonus: If you want to use the standard file API you can use the
compress.zlib://wrapper to open the archive.