Details
Thanks for making the update to help support a progress of the compression. But I think it isn't working correctly. If I set the block size to something that isn't -1, the offset seems wrong. I set it to 1000 and put it in a while loop until Finished is true, using a shift register to keep track of the File Transfer Info In and File Transfer Info Out. This shift register is initialized to 0 before entering the while loop.
Inside the Write File Offset is set to Length Rem from the ZLib Block Size. I don't think this is correct. Instead Offset should be the previous Offset, plus whatever the Block Length is from the ZLib Block Size. This way we will have Offset be 0 on the first iteration, then 1000 on the second iteration, then 2000 on the third iteration.
The File Refnum doesn't appear to be kept between calls either. If File Refnum in the File Transfer Info In is not a reference it will open it, but then it doesn't bundle it back into the File Transfer Info Out for the next iteration. I tried changing this but the next call the File Refnum is not a reference and it opens it again anyway.
Since the File Refnum keeps getting opened, it doesn't read the next N bytes. I think it keeps returning the first 1000 with every call, instead of the first 1000 then the next 1000. If I set the File Position to Offset before the read this works correctly but I don't think this should be necessary.
Please sign in to leave a comment.