in reply to Re^3: Chunking very large filesin thread Chunking very large files
In that case, $sizeRead will be smaller than $size. Possibly zero if your file is exactly a multiple of the chunk size. You then write the chunk as normal (unless its size zero), and the while loop exits.